fix: workaround `noExternal` merging bug on Vite 6 (#8950) · vitest-dev/vitest@bcb132f

File tree

1 file changed

lines changed

  • packages/vitest/src/node/plugins

1 file changed

lines changed

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

}