Skip to content

Watch Mode

Re-run recipe when files change:

Terminal window
jake -w build

Jake watches files based on:

  • File dependencies in file recipes
  • @watch directives in tasks
Terminal window
jake -w "src/**/*.ts" build

Mark files to watch in a task:

task build:
@watch src/*.ts
npm run build

Multiple patterns:

task dev:
@watch src/**/*.ts tests/**/*.ts
npm run dev
Terminal window
jake -w -v build

Shows which files triggered the rebuild.

Use is_watching() to adjust behavior:

task build:
@if is_watching()
echo "Watch mode: skipping expensive lint"
@else
npm run lint
@end
npm run build
Terminal window
# Watch with verbose output
jake -w -v build
# Watch with parallel jobs
jake -w -j4 build