BCore extensible esbuild configurations
This repository holds bcore's js bundler default configurations. If you are developing bcore apps you can use this bundler to kickstart your project's js dependencies.
The bundler expects your application's directory structure in a particular layout generated by bcore. See bcore for more information.
CLI Usage:
After adding this package to your packages.json dev dependencies you can run the following commands to build and/or watch your js files:
bundle
yarn bcore-builder bundle
watch
yarn bcore-builder watch
Adding to packages scripts
To keep things shorter and easier on your wrists, you should add bcore-builder calls in your packages script section as follows:
{
...
"scripts": {
"build": "bcore-builder bundle",
"watch": "bcore-builder watch"
},
...
}
Extending configuration
If you want to modify the esbuild configuration object you can import the builder's package and directly use its internal build method directly or import the cli to reuse the terminal interface.
Lets say you want to reuse the cli. In your codebase add ./cli.js:
import { cli } from "@bloomstack/bcore-bundler/cli.js"
await cli(import.meta, (config) => {
return config;
});
Otherwise, if you want to build your own cli interface and only require running builds and/or watching for file changes. In your code base add ./builder.js:
import { build } from "@bloomstack/bcore-bundler";
await build({
path: ".",
watch: false,
production: false,
format: "esm",
analyze: false,
minify: false,
configure(config) {
return config;
}
});
Features