Configuration is set by JSON. Config files can be written in TypeScript, JavaScript, JSON, or JSONC.
See Root Configuration and Workspace Configuration for more information on the purpose of each field.
The root configuration is for project-wide settings.
A root configuration in JSON, at path/to/your/project/bw.root.json:
{
"defaults": {
"parallelMax": 4,
"shell": "system",
"includeRootWorkspace": false
}
}
A root configuration in TypeScript, at path/to/your/project/bw.root.ts:
import { defineRootConfig } from "bun-workspaces/config";
export default defineRootConfig({
defaults: {
parallelMax: 4,
shell: "system",
includeRootWorkspace: false
}
});
Workspace configurations are defined in the directory of a workspace.
A workspace configuration in JSON, at path/to/project/workspace/bw.workspace.json:
{
"alias": "myApp",
"tags": [
"my-tag"
],
"scripts": {
"start": {
"order": 10
},
"test": {
"order": 20
}
},
"rules": {
"workspaceDependencies": {
"allowPatterns": [
"my-workspace-a",
"tag:my-tag",
"path:my-path/**/*",
"not:tag:my-excluded-tag"
]
}
}
}
A workspace configuration in TypeScript, at path/to/project/workspace/bw.workspace.ts:
import { defineWorkspaceConfig } from "bun-workspaces/config";
export default defineWorkspaceConfig({
alias: "myApp",
tags: [
"my-tag"
],
scripts: {
start: {
order: 10
},
test: {
order: 20
}
},
rules: {
workspaceDependencies: {
allowPatterns: [
"my-workspace-a",
"tag:my-tag",
"path:my-path/**/*",
"not:tag:my-excluded-tag"
]
}
}
});
Configuration is read from the following locations, in order of precedence:
bw.<config name>.tsbw.<config name>.jsbw.<config name>.jsoncbw.<config name>.jsonpackage.json["<key>"]The first configuration location found will be used.
Values related to configuration are resolved in the following order of precedence: