Bundler
The tool that resolves an application's modules into the files a browser downloads.
A bundler takes an application's entry points, follows every import to build a Module Graph, applies transforms, and emits the files a browser will actually load. It is where module resolution, transpilation, Tree Shaking, Code Splitting, asset handling, and minification all happen.
Bundlers are worth understanding because their behaviour is observable in production but invisible in source. Two bundlers given the same source can differ in ways that matter:
- Import ordering. One may sort a module namespace's keys alphabetically; another preserves source order. Anything downstream that depends on order — a registry, a hash over a list — then differs by build tool rather than by code.
- Loader support. A syntax for importing a file as raw text may exist in one and not another, so a working import becomes an unknown-module error when the build tool changes.
- Chunk grouping. How aggressively client references are merged into shared chunks decides what a page really downloads.
They also complicate development in a specific way: a development server keeps a cache and reloads when its dependency scan finds something new mid-run. That reload aborts in-flight work, which surfaces as a random test file failing on a slow machine and never reproducing on a fast one. See Flaky Test and Race Condition.
See also4
Hand-picked in the note itself — the neighbours worth reading next.
Module Graph
The directed graph of imports that decides what code ends up where.
Web Platform16 connections
Code Splitting
Dividing an application bundle so a page downloads only the code it needs.
Web Platform12 connections
Determinism
The property that identical inputs produce identical outputs, and the foundation of caching and verification.
Systems & Tooling27 connections
Package Manager
The tool that resolves, fetches, and installs dependencies, and pins them for reproducibility.
Systems & Tooling10 connections
Related2
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from10
Notes elsewhere in the wiki that reach for this one.
- Code SplittingWeb Platform
Dividing an application bundle so a page downloads only the code it needs.
- DeterminismSystems & Tooling
The property that identical inputs produce identical outputs, and the foundation of caching and verification.
- Flaky TestTesting & Verification
A test that passes and fails on identical input, and the most corrosive thing a suite can contain.
- LockfileVersion Control & Delivery
A generated file recording the exact dependency versions an install resolved to.
- Module GraphWeb Platform
The directed graph of imports that decides what code ends up where.
- MonorepoSystems & Tooling
Several packages developed in one repository with shared tooling and atomic cross-package changes.
- Package ManagerSystems & Tooling
The tool that resolves, fetches, and installs dependencies, and pins them for reproducibility.
- Race ConditionTesting & Verification
A defect whose occurrence depends on the relative timing of concurrent operations.
- Semantic VersioningVersion Control & Delivery
A version-numbering convention where the number communicates the kind of change.
- Tree ShakingWeb Platform
Statically removing exports that nothing imports, shrinking the shipped bundle.