type WatchFiles =
| {
paths: string | string[];
type?: 'reload-page';
// chokidar 选项
options?: WatchOptions;
}
| {
paths: string | string[];
type?: 'reload-server';
};
type WatchFilesConfig = WatchFiles | WatchFiles[];undefined监听指定文件和目录的变化。当文件发生变化时,可以触发页面的重新加载,或者触发 dev server 重新启动。
该配置项的使用方式与 Rsbuild 完全一致。详细信息请参考 Rsbuild - dev.watchFiles。