Configuration > Root

Project Root Configuration

The root configuration is the general configuration for a project. It is read from a file in the project root directory or the root package.json file.

The values in config.defaults can also be set by environment variables. Defaults provided in the configuration take precedence over environment variables.

See the parallel max value, the shell option for inline scripts, and the root workspace for information on the use of the config values.

Type Definition

type RootConfig = {
  defaults?: {
    parallelMax?: number | `${number}%` | "auto" | "unbounded" | "default",
    shell?: "bun" | "system" | "default",
    includeRootWorkspace?: boolean
  }
}

Examples:

1. JSON/JSONC file

path/to/your/project/bw.root.json or path/to/your/project/bw.root.jsonc

{
  "defaults": {
    "parallelMax": 4,
    "shell": "system",
    "includeRootWorkspace": false
  }
}

2. package.json

path/to/your/project/package.json
{
  "name": "my-project",
  "description": "My project root",
  "workspaces": [
    "packages/*"
  ],
  "bw-root": {
    "defaults": {
      "parallelMax": "50%",
      "shell": "system",
      "includeRootWorkspace": true
    }
  }
}