bud.before
bud.before allows you to execute arbitrary code directly prior to the start of the compilation process.
Usage
Using an asyncronous function:
- TS
- JS
- YML
- JSON
bud.config.ts
import type {Bud} from '@roots/bud'
export default async (bud: Bud) => {
bud.before(async bud => {
// Do something before the compilation has completed
})
}
bud.config.js
/** @param {import('@roots/bud').Bud} bud */
export default async (bud) => {
bud.before(async bud => {
// Do something before the compilation has completed
})
}
bud.config.yml
before: >
=> async bud => {
// do someting before the compilation has started
}
bud.config.json
{
"before": "=> async bud => {
// do something before the compilation has started
}"
}
Using a synchronous function:
- TS
- JS
- YML
- JSON
bud.config.ts
import type {Bud} from '@roots/bud'
export default async (bud: Bud) => {
bud.before(bud => {
// Do something before the compilation has completed
})
}
bud.config.js
/** @param {import('@roots/bud').Bud} bud */
export default async (bud) => {
bud.before(bud => {
// Do something before the compilation has completed
})
}
bud.config.yml
before: >
=> bud => {
// do someting before the compilation has started
}
bud.config.json
{
"before": "=> bud => {
// do something before the compilation has started
}"
}