Skip to content

Commit

Permalink
fix(vitest): lower esbuild target to node18
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jul 1, 2024
1 parent 43a60c2 commit 8814df5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/vitest/src/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ export async function VitestPlugin(
viteConfig.esbuild === false
? false
: {
// Lowest target Vitest supports is Node18
target: viteConfig.esbuild?.target || 'node18',
sourcemap: 'external',

// Enables using ignore hint for coverage providers with @preserve keyword
legalComments: 'inline',
},
Expand Down
15 changes: 9 additions & 6 deletions packages/vitest/src/node/plugins/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,15 @@ export function WorkspaceVitestPlugin(
alias: testConfig.alias,
conditions: ['node'],
},
esbuild: {
sourcemap: 'external',

// Enables using ignore hint for coverage providers with @preserve keyword
legalComments: 'inline',
},
esbuild: viteConfig.esbuild === false
? false
: {
// Lowest target Vitest supports is Node18
target: viteConfig.esbuild?.target || 'node18',
sourcemap: 'external',
// Enables using ignore hint for coverage providers with @preserve keyword
legalComments: 'inline',
},
server: {
// disable watch mode in workspaces,
// because it is handled by the top-level watcher
Expand Down

0 comments on commit 8814df5

Please sign in to comment.