# watch
Build your site and automatically rebuild when files change.
# Usage
bok watch [config]
# Arguments
| Argument | Description | Default |
|---|---|---|
config |
Path to config file | config.ts |
# What It Does
- Performs an initial build
- Watches these directories for changes:
content/- Your markdown filesassets/- Theme assetslayout/- Template files
- Rebuilds when any file changes
# Debouncing
Changes are debounced with a 500ms interval to prevent multiple rapid rebuilds when saving multiple files.
# Differences from serve
| Feature | watch |
serve |
|---|---|---|
| Builds on change | Yes | Yes |
| HTTP server | No | Yes |
| Live reload | No | Yes |
Use watch when you:
- Have your own HTTP server
- Just want to rebuild files
- Are building for deployment
Use serve when you:
- Want a complete development environment
- Need live reload in browser
# Examples
# Watch with default config
bok watch
# Watch specific config
bok watch ./docs/config.ts