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
As a developer I want vite CLI to have an option to disable watch so that I when I start a server (via vite dev) for testing purposes, the server does not start again if changed in the root are detected (due to written test results).
That is, I use npm run dev to start a server, and then I use frontend tests (in my case Selenium for some special reasons). The tests produce some output, e.g. coverage and other stuff. This causes the server to restart.
I only want to deactivate the watch when running tests, so I still want to use watch in normal development mode.
Creating a second config file is a bit troublesome, I really would prefer a CLI option.
Suggested solution
Add option
--disableWatch
(or --watch=null)
to CI tool vite
Alternative
No response
Additional context
This feature request is related to #8341 (which wants to limit the watcher)
import{defineConfig}from'vite';exportdefaultdefineConfig({server: {// then run // DISABLE_WATCH=1 vite devwatch: process.env.DISABLE_WATCH ? null : undefined,},});
Disabling watch is not very common when running vite dev, so I'm not sure if it's worth a new option here. Is there reason also you're testing your app against the dev server? Shouldn't it be the built preview server? The build output is able to generate optimized assets that can load certain things faster, which would be more stable for e2e tests.
Description
As a developer I want vite CLI to have an option to disable watch so that I when I start a server (via vite dev) for testing purposes, the server does not start again if changed in the root are detected (due to written test results).
That is, I use
npm run dev
to start a server, and then I use frontend tests (in my case Selenium for some special reasons). The tests produce some output, e.g. coverage and other stuff. This causes the server to restart.I only want to deactivate the watch when running tests, so I still want to use watch in normal development mode.
Creating a second config file is a bit troublesome, I really would prefer a CLI option.
Suggested solution
Add option
--disableWatch
(or --watch=null)
to CI tool vite
Alternative
No response
Additional context
This feature request is related to #8341 (which wants to limit the watcher)
Validations
The text was updated successfully, but these errors were encountered: