High-performance monorepo build system with Turborepo. Use when configuring workspaces, optimizing build pipelines, setting up caching, or managing multi-package repositories. Triggers on Turborepo, monorepo, workspace, build caching, or pipeline questions.
Turborepo is a high-performance build system for JavaScript/TypeScript monorepos. It provides intelligent caching, parallel execution, and incremental builds.
my-turborepo/
├── apps/
│ ├── web/ # Next.js app
│ │ ├── package.json
│ │ └── next.config.js
│ └── docs/ # Documentation site
│ └── package.json
├── packages/
│ ├── ui/ # Shared component library
│ │ ├── package.json
│ │ └── src/
│ ├── config/ # Shared configs (ESLint, TS, etc.)
│ │ └── package.json
│ └── utils/ # Shared utilities
│ └── package.json
├── turbo.json # Turborepo configuration
├── package.json # Root package.json
└── pnpm-workspace.yaml # Workspace definition
{
"$schema": "https://turborepo.com/schema.json",
"ui": "stream",
"envMode": "strict",
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
"env": ["NODE_ENV", "DATABASE_URL", "NEXT_PUBLIC_*"]
},
"dev": {
"cache": false,
"persistent": true,
"interactive": true
},
"lint": {
"dependsOn": ["^build"],
"outputs": []
},
"test": {
"dependsOn": ["build"],
"inputs": ["src/**", "test/**"],
"outputs": ["coverage/**"]
},
"typecheck": {
"dependsOn": ["^build"],
"outputs": []
}
}
}
{
"name": "my-turborepo",
"private": true,
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"lint": "turbo run lint",
"test": "turbo run test",
"typecheck": "turbo run typecheck",
"clean": "turbo run clean && rm -rf node_modules"
},
"devDependencies": {
"turbo": "^2.7.2"
},
"packageManager": "[email protected]"
}