From 838dbe76120a76b53cd1d29d1b538b707fa6ac64 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Mon, 16 Jan 2023 10:56:07 +0100 Subject: [PATCH] fix: don't start watching files in "run" mode --- packages/vitest/src/node/plugins/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) 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 {