Skip to main content

bud.use

Register an extension or set of extensions.

Usage

Add extensions:

import swc from '@roots/bud-swc'

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

You can register multiple extensions at once by passing an array of extensions.

import swc from '@roots/bud-swc'
import react from '@roots/bud-react'

export default async bud => {
bud.use([swc, react])
}

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

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

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

bud.use(new MyWebpackPlugin())

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

bud.use(`my-webpack-plugin`)

Additional information

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. The extensions will be discovered automatically.