Skip to content

Commit 74a2075

Browse files
docs: document $TURBO_ROOT$
1 parent 966c118 commit 74a2075

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/site/content/repo-docs/reference/configuration.mdx

+19
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,8 @@ An allowlist of environment variables that should be made available to this task
358358

359359
A list of file glob patterns relative to the package's `package.json` to cache when the task is successfully completed.
360360

361+
See [`$TURBO_ROOT$`](#turbo_root) if output paths need to be relative to the repository root.
362+
361363
```jsonc title="./turbo.json"
362364
{
363365
"tasks": {
@@ -431,6 +433,23 @@ the special string `$TURBO_DEFAULT$` within the `inputs` array to restore `turbo
431433
}
432434
```
433435

436+
#### `$TURBO_ROOT$`
437+
438+
Tasks might reference a file that lies outside of their directory.
439+
440+
Starting a file glob with `$TURBO_ROOT$` will change the glob to be relative to the root of the repository instead of the package directory.
441+
442+
```jsonc title="./turbo.json"
443+
{
444+
"tasks": {
445+
"check-types": {
446+
// Consider all Typescript files in `src/` and the root tsconfig.json as inputs
447+
"inputs": ["$TURBO_ROOT$/tsconfig.json", "src/**/*.ts"]
448+
}
449+
}
450+
}
451+
```
452+
434453
### `outputLogs`
435454

436455
Default: `full`

0 commit comments

Comments
 (0)