Turborepo is a build system for JavaScript/TypeScript monorepos. It caches task results, runs tasks in parallel, and makes your CI 10x faster.
Why Turborepo?
- Caching — never rebuild what hasn't changed
- Parallel — run independent tasks simultaneously
- Remote caching — share cache across team/CI
- Zero config — works with npm, pnpm, yarn workspaces
Quick Start
npx create-turbo@latest
turbo.json
{
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"test": {
"dependsOn": ["build"]
},
"lint": {},
"dev": {
"cache": false,
"persistent": true
}
}
}
Commands
turbo build # Build all packages
turbo test # Test all packages
turbo lint # Lint all packages
turbo build --filter=web # Build only 'web' package
turbo build --filter=./apps/* # Build all apps
Workspace Structure
my-monorepo/
├── apps/
│ ├── web/ # Next.js app
│ └── api/ # Express server
├── packages/
│ ├── ui/ # Shared React components
│ ├── config/ # Shared ESLint/TS config
│ └── utils/ # Shared utilities
├── turbo.json
└── package.json
Remote Caching
npx turbo login
npx turbo link
# Now CI uses shared cache — builds are instant if nothing changed
Scaling your development workflow? Check out my Apify actors for web scraping, or email spinov001@gmail.com for custom monorepo solutions.
Turborepo, Nx, or Moon — which monorepo tool do you use? Share below!
Top comments (0)