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
Currently server.watch option allows passing options to chokidar. Docs state that the glob can be negated for a node_module to be included, but it doesn't seem to be working for other files which were not previously excluded.
For example, I want to cause a plugin to be called whenever a file /config.json is changed, because that plugin generates an in-memory new json which the app consumes. Ideally that would trigger a reload, like when modifying vite.config.ts.
Trying the following doesn't work, and because the included files are not part of the chokidar options, it looks that there is no way to watch for additional files:
server: {
watch: {
ignored: ['!/config.json']
}
}
Suggested solution
Make the previous negated ignored globs functional or add a new include options to server.watch.
Can't. But wouldn't be this the only needed thing? I spent a lot of time yesterday googling and trying lots of different permutations of the below and couldn't see any other thing that this one, but it doesn't work. My concern is if Vite is stopping this to work in some way, because all the stuff I've found on the internet was related to Rollup, not Vite.
Description
Currently
server.watch
option allows passing options tochokidar
. Docs state that the glob can be negated for anode_module
to be included, but it doesn't seem to be working for other files which were not previously excluded.For example, I want to cause a plugin to be called whenever a file
/config.json
is changed, because that plugin generates an in-memory newjson
which the app consumes. Ideally that would trigger a reload, like when modifyingvite.config.ts
.Trying the following doesn't work, and because the included files are not part of the
chokidar
options, it looks that there is no way to watch for additional files:Suggested solution
Make the previous negated ignored globs functional or add a new
include
options toserver.watch
.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: