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.
// path/to/your/project/bw.root.ts
import { defineRootConfig } from "bun-workspaces/config";
export default defineRootConfig({
defaults: {
parallelMax: 4,
shell: "system",
includeRootWorkspace: false,
affectedBaseRef: "my-branch"
},
workspacePatternConfigs: [
{
patterns: [
"path:libraries/frontend/**/*"
],
config: {
tags: [
"frontend",
"library"
]
}
}
]
});
Workspace configurations are defined in the directory of a workspace.
// path/to/your/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 files can be read from the following location. The first to be resolved in this order will be used:
bw.<name>.tsbw.<name>.jsbw.<name>.jsoncbw.<name>.jsonpackage.json["<key>"]Values related to configuration are resolved in the following order of precedence: