> For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt.

# dev.watchFiles

- **类型：**

```ts
type WatchFiles =
  | {
      paths: string | string[];
      type?: 'reload-page';
      //  chokidar 选项
      options?: WatchOptions;
    }
  | {
      paths: string | string[];
      type?: 'reload-server';
    };

type WatchFilesConfig = WatchFiles | WatchFiles[];
```

- **默认值：** `undefined`

监听指定文件和目录的变化。当文件发生变化时，可以触发页面的重新加载，或者触发 dev server 重新启动。

:::info
该配置项的使用方式与 Rsbuild 完全一致。详细信息请参考 [Rsbuild - dev.watchFiles](https://v2.rsbuild.dev/zh/config/dev/watch-files)。
:::