Skip to main content

bud.use

Register an extension or set of extensions.

bud.use is an asyncronous function that takes a single argument, extensions. It returns a Promise that resolves to the bud instance. You can register multiple extensions at once by passing an array of extensions.

If your extension is listed in package.json dependencies or devDependencies it is not necessary to call bud.use to use an extension. The extensions will be discovered automatically before the configuration file is even loaded.

Usage

Add bud extensions:

bud.config.js
import babel from '@roots/bud-babel'
import react from '@roots/bud-react'

export default async bud => {
bud.use(babel)
}

Add an extension inline (also works with an array of extensions):

bud.config.js
bud.use({
name: 'my-webpack-plugin',
make: () => new MyWebpackPlugin(),
})

Add a webpack plugin inline (also work with an array of plugins):

bud.config.js
bud.use(new MyWebpackPlugin())

Add an extension or plugin from its signifier (must be the default export):

bud.config.js
bud.use(`my-webpack-dashboard`)