References — fw-07 A Minimal Bundler
Primary sources first. Read the real implementation after you have written yours, never before.
Module semantics — get these right first
- ECMAScript modules — the normative semantics: live bindings, hoisting, cyclic module records. Most bundler bugs are misunderstandings here.
- HTML Standard — module scripts
- Node.js — Modules: ECMAScript modules — resolution algorithm,
exportsmaps, the dual-package hazard package.jsonexports— the field that decides what a bundler is even allowed to import
Bundlers to read
- Rollup — the cleanest architecture to learn from; its plugin interface became the de-facto standard
- esbuild — read the architecture notes; an unusually good description of why it is fast
- Vite — dev-server/production-build split; the dep pre-bundling rationale is worth understanding
- Webpack module federation — relevant to fe-41 microfrontends
Tree shaking
- Rollup — tree shaking and the
sideEffectsfield - Rich Harris — Tree-shaking versus dead code elimination — the distinction matters more than the name suggests
Related modules
- fw-06 — Compilers — what produces the modules being bundled
- fe-23 — Loading architecture (planned) — code splitting, preload, and what any of it buys
- fe-03 — Object shapes & JIT (sibling project) — the perspective method for pricing bundle-size claims
When a claim here proves stale, record it in PROGRESS.md section 7.