dependsOn
The turbo.json setting that lists which tasks must finish before a task runs, where a leading caret means the same task in every dependency package.
In more detail
dependsOn: ["^build"] tells Turborepo that a package’s build may only start after the build of every workspace package it depends on has finished. Without the caret, the name refers to another task in the same package, such as running codegen before build.
Example
"build": { "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**"] }Related terms
- Turborepo — A build tool for JavaScript monorepos that runs package tasks in dependency order, in parallel, and skips work whose inputs have not changed.
- topological sort — An ordering of a directed graph's vertices in which every edge points from an earlier vertex to a later one.
- task graph — A map of which build tasks depend on which others, used to decide what must run first and what can run at the same time.
Taught in
- Monorepo Architecture: Workspaces & Turborepo — Production Full-Stack Engineering