turbo.json Config Builder

Generate a turbo.json pipeline configuration for Turborepo monorepos

Creates a turbo.json with task definitions for build, test, lint, and dev including dependsOn, outputs, cache, persistent, globalEnv, and globalDependencies settings for fast incremental monorepo builds.

What does the ^ prefix mean in dependsOn?

A caret like ^build means a task depends on the same task in its dependency packages, building them first in topological order. Without the caret, the dependency refers to a task within the same package, such as build depending on its own lint.

Build a Turborepo pipeline

Turborepo speeds up monorepo builds by running tasks in dependency order and caching their results so unchanged work is never repeated. The brain of that system is turbo.json, where you declare each task and how it relates to others. This builder generates a correct turbo.json for the standard build, test, lint, and dev tasks.

How it works

Each entry under tasks describes one runnable script. dependsOn controls ordering: a plain name like build means an in-package dependency, while a ^build caret means “run this task in all dependency packages first” — that topological ordering is what makes Turborepo correct for inter-package builds.

outputs is a list of globs Turbo saves to its cache after a successful run, like dist/** or .next/**. On a later run with the same inputs, Turbo restores those files instantly instead of re-running the task. Setting cache: false opts a task out of caching, which you want for dev. Marking a task persistent: true tells Turbo it never exits, which is required for watch and dev servers.

At the top level, globalEnv and globalDependencies add inputs to every task’s cache hash, so changing NODE_ENV or a root tsconfig.json correctly invalidates all caches.

Tips and notes

  • Always pair a cached build with an outputs glob, or the cache restores nothing.
  • Use ^build for build so dependency packages compile first.
  • Set cache: false and persistent: true for dev.
  • This file uses the tasks key (Turborepo 2.x); rename to pipeline for 1.x.