Build Pipeline
bb build turns src/ plus packs/ into
dist/packs/BP/ and dist/packs/RP/. The pipeline is incremental:
unchanged files copy once and skip on the next run.
Stages
-
Bundle: esbuild compiles the entry file to
BP/scripts/main.js. Dev mode keeps sourcemaps and skips minify. Release mode minifies and drops sourcemaps. - Scan: the pipeline lists every file under both pack folders.
- Classify: each file matches a processor by extension and path. JSON validates, PNG decodes, audio normalizes, text copies.
- Cache: each file hashes with sha256. Unchanged hash plus mode plus existing output means skip.
-
Prune: outputs with no matching source are removed, so deleted files never linger in
dist/.
Dev versus release
bb build
$ bb build --release
Dev is the default: fast, sourcemaps inline, no minify. Release minifies the bundle and runs the
full pipeline with release mode.
bb ship always builds release first.
Extensions
The pipeline loads user extensions from the extensions array in the config. Missing
or broken extensions warn and skip, never fail the build. Core texture and audio helpers stay
exported for extension authors. List resolved extensions with bb ext.
Typecheck
bb build --typecheck
$ bb run --watch
Typecheck is opt-in on build and ship through tsc --noEmit.
The bundler never typechecks. bb run --watch runs a parallel
tsc --watch that prints errors on save without blocking the rebuild.