undefined
Watch files and directories for changes. When a file changes, the page will be reloaded.
If both dev.hmr
and dev.liveReload
are set to false, watchFiles
will be ignored.
By default, Rsbuild (Rspack) watches all build dependencies and triggers a rebuild when any of these files change. If you want the page to automatically reload when some non-build dependency files change, you can use this configuration.
It's important to note that changes in files listed under watchFiles
do not trigger a rebuild or reloading of the configuration file.
Furthermore, if you want changes in a build dependency file to not trigger a rebuild, you can use the watchOptions.ignored setting in Rspack.
For instance, if you want to prevent a rebuild when files in the node_modules
directory change, you can configure it as follows:
You can configure a list of globs/directories/files to watch for file changes.
You can also specify chokidar watcher options by passing an object with paths
and options
properties.