Watch Mode
chant includes a watch mode that monitors your source files and automatically re-runs on changes. Available on both build and lint commands.
chant build --watchchant lint --watchHow It Works
Section titled “How It Works”- File system monitoring — watches for file create, modify, and delete events
- Debouncing — changes are batched with a short debounce window
- Full re-runs — each batch of changes triggers a full rebuild or re-lint
Watched and Ignored Paths
Section titled “Watched and Ignored Paths”Watch mode monitors all .ts files, with these exclusions:
| Ignored Pattern | Reason |
|---|---|
node_modules/ | Dependencies don’t change during development |
.chant/ | Generated types and metadata |
Hidden directories (.*/) | .git/, editor configs, tool caches |
*.test.ts, *.spec.ts | Test files |
Non-.ts files | Only .ts files are watched |
- Large projects: Debouncing keeps re-runs efficient by batching rapid file saves
- Terminal multiplexing: Run watch mode in one terminal pane and your editor in another