esbuild build pipeline and safeguards

Updated Jul 27, 2026

The repository now bundles with esbuild by default:

  • bun run dev: esbuild watch mode plus tsgo --build --watch
  • bun run build: production esbuild bundles plus tsgo --build
  • bun run build:hyper-app: copy-only app artefact pipeline via esbuild support scripts

ADR 002 still requires test-first discipline for any follow-on changes to bundler scripts, bundler configuration, or custom esbuild plugin logic. Contract suites must stay in place and green before changing default build paths or plugin behaviour.

Required coverage categories:

  • Translation outcomes: verify CSS Modules bundling, externals mapping, source maps, and production minification output.
  • Packaging outcomes: verify copied artefacts under dist/app/ and CLI artefact shape (including shebang integrity).
  • Bespoke plugin validation: add deterministic unit tests for each custom esbuild plugin path (resolve/load/copy/ignore behaviour and diagnostics).

Follow docs/execplans/replace-webpack-babel-with-esbuild.md for migration ordering and milestone gates.