DEV Community

Alex Spinov
Alex Spinov

Posted on

Turborepo Has a Free Build System That Makes Monorepos 10x Faster — Remote Caching + Parallel Tasks

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": {}
  }
}
Enter fullscreen mode Exit fullscreen mode
turbo run build test lint
Enter fullscreen mode Exit fullscreen mode

Turborepo:

  1. Analyzes dependencies between packages
  2. Runs independent tasks in parallel
  3. Respects dependency order (build before test)
  4. 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
Enter fullscreen mode Exit fullscreen mode

First run: 2 minutes. Second run: 200ms. Only rebuilds what changed.

Remote Caching

npx turbo login
npx turbo link
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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]
Enter fullscreen mode Exit fullscreen mode

Quick Start

npx create-turbo@latest
cd my-turborepo
turbo run build
Enter fullscreen mode Exit fullscreen mode

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)