Bundle Analysis & Trimming Unused Code
Read bundle reports, find big modules, and trim them with tree-shaking friendly code: ESM named exports, no top-level side effects, lazy where sensible.
Why analyze bundles?
Goal: Slim your bundle.
- Read bundle reports
- Adopt tree-shakeable ESM
- Lazy-load rare screens
Signals in reports
- Big deps (charts, date libs)
- Duplicate versions
- Top-level side effects
- Default imports that pull whole packages
All lessons in this course
- Dev/Prod Builds, Source Maps, Envs
- Bundle Analysis & Trimming Unused Code
- Basic CI: Lint → Test → Build