The Monorepo Problem
You have 10 packages in a monorepo. Running npm test across all of them takes 15 minutes. CI costs are through the roof. Half the builds test code that hasn't changed.
Turborepo understands your dependency graph. It only runs tasks for packages that actually changed. And it caches everything.
What Turborepo Gives You
Intelligent Task Scheduling
{
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"test": {
"dependsOn": ["build"]
},
"lint": {}
}
}
turbo run build test lint
Turborepo:
- Analyzes dependencies between packages
- Runs independent tasks in parallel
- Respects dependency order (build before test)
- Skips unchanged packages entirely
Local Caching
$ turbo run build
• Packages in scope: web, api, shared, ui
• Running build in 4 packages
web:build: cache hit, replaying logs
api:build: cache hit, replaying logs
shared:build: cache hit, replaying logs
ui:build: cache miss, executing
First run: 2 minutes. Second run: 200ms. Only rebuilds what changed.
Remote Caching
npx turbo login
npx turbo link
Share caches across your team and CI. When your teammate already built a package, you get the cached result. Free tier: 10GB.
Watch Mode
turbo watch dev
Runs all dev servers in parallel. When a shared package changes, only dependent packages restart.
Filtering
# Only run for web app and its dependencies
turbo run build --filter=web...
# Only changed packages since main
turbo run test --filter=[main...HEAD]
Quick Start
npx create-turbo@latest
cd my-turborepo
turbo run build
Works with npm, yarn, pnpm, and bun.
Why This Matters
Monorepos shouldn't mean slow builds. Turborepo gives you the organizational benefits of a monorepo with single-package build speeds.
Building data-intensive monorepo projects? Check out my web scraping actors on Apify Store — structured data APIs for your packages. For custom solutions, email spinov001@gmail.com.
Top comments (0)