-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addWatchFile can not be used to watch files outside of the module graph #7024
Comments
I assume the expectation here is to force a full page reload, yeah? |
@jplhomer Yes that would be the expectation. I don't think that HMR is possible in this case or even makes sense because the user wants to add arbitrary files to the watcher with the |
@jplhomer I was able to workaround the issue by adding a hook for @see zauni/rollup-plugin-openapi@4a2b480 Should I leave the issue open to address the underlying problem with |
Seems like the underlying problem should still be addressed 👍 |
Co-authored-by: Matt Jones <mattjones701@gmail.com>
Describe the bug
When I am writing a plugin and using "addWatchFile" inside the plugin to watch files which are not imported in some JS file, then Vite is tracking that the file has changed, but doesn't reload because of the message "no modules matched"
For example I added
some-other-file.yaml
with "addWatchFile" and then Vite in debug mode logs this on changes:In the reproduction you have to do
npm run dev
and then change the filesome-other-file.yaml
to see this output.If I do this in rollup, it is doing the reload on file changes. But Vite is somewhere loosing the info of the file path inside the module graph.
This was noticed when developing the rollup-plugin-openapi
Reproduction
https://stackblitz.com/edit/vitejs-vite-wuaaxt?file=vite.config.js
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: