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 string reference to your application's entrypoint.

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

For more control over naming, you may pass two parameters. The first will be used as the name, and the second as the asset signifier.

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

It is also possible to pass an array of assets (with or without an entrypoint name). 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 also 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 additional properties

The entire EntryObject API is available to you.

As an example, bud.js supports the 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 may pair bud.entry with bud.glob if you need it.

bud.config.js
bud.entry({
app: await bud.glob('./src/*.{css,js}'),
})