---
title: watch
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

The `watch` command will monitor the local file system for any changes and trigger a
[rebuild](./build) for a package. The watcher will only monitor files within the `src` folder of the
package, and will rebuild using default build options.

```json title="package.json"
{
  "scripts": {
    "watch": "packemon watch"
  }
}
```

Chokidar is required for file watching, so please install to your project.

<Tabs
  groupId="package-manager"
  defaultValue="yarn"
  values={[
    { label: 'Yarn', value: 'yarn' },
    { label: 'npm', value: 'npm' },
  ]}
>
  <TabItem value="yarn">

```bash
yarn add --dev chokidar
```

  </TabItem>
  <TabItem value="npm">

```bash
npm install --save-dev chokidar
```

  </TabItem>
</Tabs>

## Options

Watch supports the following command line options.

- `--debounce` - Number of milliseconds to wait after a change before triggering a rebuild. Defaults
  to `150`.
- `--poll` - Poll for file changes instead of using file system events. This is necessary if going
  across the network or through containers.
- `--skipPrivate` - Skip `private` packages from being watched.
