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

# dev.watchFiles

- **Type:**

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

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

- **Default:** `undefined`

Watch specified files and directories for changes. When a file change is detected, it can trigger a page reload or restart the dev server.

:::info
The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to [Rsbuild - dev.watchFiles](https://v2.rsbuild.dev/config/dev/watch-files).
:::