Skip to content

Commit

Permalink
fix(coverage): env-replacer to add filenames into sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Nov 16, 2022
1 parent 3038991 commit 64d66d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vitest/src/node/plugins/envReplacer.ts
Expand Up @@ -8,7 +8,7 @@ export const EnvReplacerPlugin = (): Plugin => {
return {
name: 'vitest:env-replacer',
enforce: 'pre',
transform(code) {
transform(code, id) {
if (!/\bimport\.meta\.env\b/g.test(code))
return null

Expand All @@ -27,7 +27,7 @@ export const EnvReplacerPlugin = (): Plugin => {
if (s) {
return {
code: s.toString(),
map: s.generateMap({ hires: true }),
map: s.generateMap({ hires: true, source: id }),
}
}
},
Expand Down

0 comments on commit 64d66d9

Please sign in to comment.