---
title: watchFiles
configName: dev.watchFiles
---

# 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.

import RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';

<RsbuildConig />
