Turborepo is a high-performance build system for JavaScript and TypeScript monorepos. It provides remote caching, parallel execution, and intelligent task scheduling — all for free.
Getting Started
npx create-turbo@latest my-monorepo
cd my-monorepo
turbo.json Configuration
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
},
"lint": {
"dependsOn": ["^build"]
},
"test": {
"dependsOn": ["build"],
"outputs": ["coverage/**"]
},
"dev": {
"cache": false,
"persistent": true
}
}
}
Running Tasks
# Build all packages in dependency order
turbo build
# Run only changed packages
turbo build --filter=...[HEAD~1]
# Run specific package and its dependencies
turbo build --filter=web...
# Parallel lint and test
turbo lint test
Remote Caching
# Login to Vercel for remote caching
npx turbo login
npx turbo link
# Now builds are cached across your team
turbo build # First run: builds everything
turbo build # Second run: instant cache hit
Workspace Dependencies
// apps/web/package.json
{
"dependencies": {
"@repo/ui": "workspace:*",
"@repo/config": "workspace:*"
}
}
Turborepo automatically understands the dependency graph and builds packages in the correct order.
Task Graph Visualization
turbo build --graph=graph.svg
This generates a visual graph of your task dependencies — invaluable for debugging build order issues.
Need to extract or automate web content at scale? Check out my web scraping tools on Apify — no coding required. Or email me at spinov001@gmail.com for custom solutions.
Top comments (0)