diff --git a/packages/vitest/src/node/plugins/index.ts b/packages/vitest/src/node/plugins/index.ts index 485e6be506a5..1e6bd5f97690 100644 --- a/packages/vitest/src/node/plugins/index.ts +++ b/packages/vitest/src/node/plugins/index.ts @@ -172,6 +172,15 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t for (const name in envs) process.env[name] ??= envs[name] + + // don't watch files in run mode + if (!options.watch) { + viteConfig.server.watch = { + persistent: false, + depth: 0, + ignored: ['**/*'], + } + } }, async configureServer(server) { try {