Skip to content

Commit 0a31e85

Browse files
authoredJan 16, 2023
fix: don't start watching files in "run" mode (#2680)
1 parent 8509628 commit 0a31e85

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
@@ -172,6 +172,15 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
172172

173173
for (const name in envs)
174174
process.env[name] ??= envs[name]
175+
176+
// don't watch files in run mode
177+
if (!options.watch) {
178+
viteConfig.server.watch = {
179+
persistent: false,
180+
depth: 0,
181+
ignored: ['**/*'],
182+
}
183+
}
175184
},
176185
async configureServer(server) {
177186
try {

0 commit comments

Comments
 (0)
Please sign in to comment.