Skip to main content

bud.entry

Specify a set of assets to include in the compilation.

If no entrypoint is provided bud will attempt to compile src/index.js to dist/main.js.

Usage

The simplest usage is just a name for the entrypoint and the asset to compile

bud.config.js
bud.entry('app', 'app.js')

It is also possible to pass an array of assets. Assets do not have to be the same filetype to be grouped together as a single entrypoint.

bud.config.js
bud.entry('app', ['app.js', 'app.css'])

You may specify multiple entrypoints in one call using object syntax

bud.config.js
bud.entry({
app: ['app.js', 'app.css'],
admin: ['admin.js', 'admin.css'],
})

Specifying dependencies

Bud supports the new Webpack 5 dependOn syntax for explicitly defining entrypoint dependencies.

bud.config.js
bud.entry({
react: ['react', 'react-dom'],
app: {
import: ['app.js', 'app.css'],
dependOn: ['react'],
},
})

Globbing

You can specify assets using fast-glob syntax.

  • * matches any number of characters, but not /
  • ? matches a single character, but not /
  • ** matches any number of characters, including /, as long as it's the only thing in a path part
  • {} allows for a comma-separated list of "or" expressions
  • ! at the beginning of a pattern will negate the match