Skip to content

Commit

Permalink
fix: disable ESBuild when user config disables it (#4492)
Browse files Browse the repository at this point in the history
  • Loading branch information
Namchee authored Nov 13, 2023
1 parent e5cf141 commit 9abde20
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/vitest/src/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t

const config: ViteConfig = {
root: viteConfig.test?.root || options.root,
esbuild: {
sourcemap: 'external',

// Enables using ignore hint for coverage providers with @preserve keyword
legalComments: 'inline',
},
esbuild: viteConfig.esbuild === false
? false
: {
sourcemap: 'external',

// Enables using ignore hint for coverage providers with @preserve keyword
legalComments: 'inline',
},
resolve: {
// by default Vite resolves `module` field, which not always a native ESM module
// setting this option can bypass that and fallback to cjs version
Expand Down

0 comments on commit 9abde20

Please sign in to comment.