Track file modifications and only rebuild when sources change. Chain builds together for multi-stage pipelines that skip unnecessary work automatically.
src/**/*.ts # File target with glob pattern
file dist/bundle.js: src/**/*.ts
esbuild src/index.ts --bundle --outfile=dist/bundle.js
# Chain file targets together
file dist/app.min.js: dist/bundle.js
terser dist/bundle.js -o dist/app.min.js
# Task depends on file target
task build: [dist/app.min.js]
echo "Build complete!" Jake checks modification times and only runs commands when sources are newer than outputs.
Jake checks if dist/bundle.js exists. It doesn't, so Jake runs the build command.
Jake expands src/**/*.ts and compares timestamps. All sources are older than the output, so Jake skips the build.
You edit src/index.ts. Now one source is newer than the output, so Jake rebuilds.
$ jake build
→ dist/bundle.js
esbuild src/index.ts --bundle --outfile=dist/bundle.js
✓ dist/bundle.js (0.42s)
→ dist/app.min.js
terser dist/bundle.js -o dist/app.min.js
✓ dist/app.min.js (0.18s)
→ build
echo "Build complete!"
✓ build (0.01s)
$ jake build # Run again
⊘ dist/bundle.js (up to date)
⊘ dist/app.min.js (up to date)
✓ build (0.01s) Match files with powerful glob syntax—no need to list every file manually.
| Pattern | Matches |
|---|---|
| *.ts | TypeScript files in current directory |
| **/*.ts | TypeScript files anywhere (recursive) |
| src/**/*.{ts,tsx} | TS/TSX files under src/ |
| [abc].txt | a.txt, b.txt, or c.txt |
| ??.js | Two-character JS files |
File targets work with any build tool or language.
file dist/index.js: src/**/*.ts tsconfig.json
npx tsc file dist/styles.css: src/**/*.scss
sass src/main.scss dist/styles.css file app: *.c *.h
gcc -o app *.c file .docker-built: Dockerfile src/**/*
docker build -t myapp . && touch .docker-built Same power, cleaner syntax.
# Makefile
dist/app.js: $(wildcard src/*.ts)
esbuild src/index.ts --bundle -o $@ # Jakefile
file dist/app.js: src/**/*.ts
esbuild src/index.ts --bundle --outfile=dist/app.js Add incremental builds to your project in minutes.