Skip to content

Commit bcb132f

Browse files
authored
fix: workaround noExternal merging bug on Vite 6 (#8950)
1 parent 997ca5a commit bcb132f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/vitest/src/node/plugins/runnerTransform.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ export function ModuleRunnerTransform(): VitePlugin {
145145
// in both SSR and Client environments
146146
environment.resolve.noExternal = true
147147

148+
// Workaround `noExternal` merging bug on Vite 6
149+
// https://github.com/vitejs/vite/pull/20502
150+
if (name === 'ssr') {
151+
delete config.ssr?.noExternal
152+
}
153+
148154
if (name === '__vitest_vm__' || name === '__vitest__') {
149155
continue
150156
}

0 commit comments

Comments
 (0)