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
The documentation at https://vitejs.dev/config/server-options.html#server-watch is unclear about how to add a specific folder / file extension glob to be watched. In my case, i have a directory with svg files in it svg/*/*.svg. I would like vite to reload when I edit an SVG file but it does not. An example with this would be really useful.
The doc is clear on how to use server.watch to set options for chokidar, but it's unclear how to specify the paths, as per chokidar.watch(paths, [options])
Your Suggestion for Changes
Add an example on how to set up additional folders or file extensions to be watched for changes and cause a reload, using globs.
Reproduction
No response
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered:
The watch option is not used to configure files that are watched and reload the browser. Vite will watch them, but reloads only happen if they invalidate the page, e.g. they're imported and Vite is able to see and tell the browser to apply HMR. If you want to always reload regardless of that, you should use https://github.com/antfu/vite-plugin-restart with the reload option (looks like it's not documented in the readme, but it exists in source code). Maybe the docs can explain and point to this plugin.
Documentation is
Explain in Detail
The documentation at https://vitejs.dev/config/server-options.html#server-watch is unclear about how to add a specific folder / file extension glob to be watched. In my case, i have a directory with svg files in it
svg/*/*.svg
. I would like vite to reload when I edit an SVG file but it does not. An example with this would be really useful.The doc is clear on how to use
server.watch
to set options for chokidar, but it's unclear how to specify thepaths
, as perchokidar.watch(paths, [options])
Your Suggestion for Changes
Add an example on how to set up additional folders or file extensions to be watched for changes and cause a reload, using globs.
Reproduction
No response
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered: