Skip to content

Commit

Permalink
fix(vitest): watch the output directory correctly (#5584)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Apr 22, 2024
1 parent ba5c93e commit e40f992
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/vitest/src/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
allow: resolveFsAllow(getRoot(), testConfig.config),
},
},
build: {
// Vitest doesn't use outputDir, but this value affects what folders are watched
// https://github.com/vitest-dev/vitest/issues/5429
// This works for Vite <5.2.10
outDir: 'dummy-non-existing-folder',
// This works for Vite >=5.2.10
// https://github.com/vitejs/vite/pull/16453
emptyOutDir: false,
},
test: {
poolOptions: {
threads: {
Expand Down

0 comments on commit e40f992

Please sign in to comment.