Skip to content

Commit e40f992

Browse files
authoredApr 22, 2024
fix(vitest): watch the output directory correctly (#5584)
1 parent ba5c93e commit e40f992

File tree

1 file changed

+9
-0
lines changed
  • packages/vitest/src/node/plugins

1 file changed

+9
-0
lines changed
 

‎packages/vitest/src/node/plugins/index.ts

+9
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
9090
allow: resolveFsAllow(getRoot(), testConfig.config),
9191
},
9292
},
93+
build: {
94+
// Vitest doesn't use outputDir, but this value affects what folders are watched
95+
// https://github.com/vitest-dev/vitest/issues/5429
96+
// This works for Vite <5.2.10
97+
outDir: 'dummy-non-existing-folder',
98+
// This works for Vite >=5.2.10
99+
// https://github.com/vitejs/vite/pull/16453
100+
emptyOutDir: false,
101+
},
93102
test: {
94103
poolOptions: {
95104
threads: {

0 commit comments

Comments
 (0)