You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Vitest starts in run mode, watcher is initiated and later stopped. In this time watcher can start watching a lot of files.
We should probably not even initiate chokidar watcher. To do this, we need to pass down watch: { ignored: ['*'] } to createServer.
There is a problem that watch and run flags can be configured inside vite.config, which is resolved after createServer call. We should disable this, and allow --watch and --run to be configured only as CLI flags. This way we can determine watch mode before calling createServer. This would be a breaking change.
There is a problem that watch and run flags can be configured inside vite.config, which is resolved after createServer call.
Having these flags in the config is convenient though as I can just npx vite and have it not watch. Can the config be parsed first? Generally I'd say parsing config is the first thing a application should do.
Describe the bug
When Vitest starts in
run
mode, watcher is initiated and later stopped. In this time watcher can start watching a lot of files.We should probably not even initiate chokidar watcher. To do this, we need to pass down
watch: { ignored: ['*'] }
tocreateServer
.There is a problem that
watch
andrun
flags can be configured insidevite.config
, which is resolved aftercreateServer
call. We should disable this, and allow--watch
and--run
to be configured only as CLI flags. This way we can determine watch mode before callingcreateServer
. This would be a breaking change.Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-q5uxuk?file=README.md&initialPath=__vitest__
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: