v2.6 • Dev Tools • 21kb gzipped • MIT
BundleLens
Bundle analysis that tells you which import cost you the weight, not just which file is large.

// why bundlelens
Blame, not just size
Traces every byte back to the import that pulled it in, so you find the dependency rather than the chunk.
// stack
Works with your bundler
Reads the stats output from the common bundlers rather than replacing your build.
BundleLens started as a single file in a client project and stayed small on purpose. It does one job, it does it in 21kb gzipped, and it has no runtime dependencies.
Getting started
Install it, import it, call it:
npm i bundlelens-js
Traces every byte back to the import that pulled it in, so you find the dependency rather than the chunk.
What it does not do
It does not manage your state, style your components or ship a plugin system. Those are your decisions, and keeping them out is what keeps the bundle honest.
- Import attribution
- Budget checks in CI
- MIT licensed, commercially friendly
Features
Import attribution
Every module is attributed to the entry point and import chain that required it.
Budget checks in CI
Fails a build when a bundle crosses a threshold you set per entry point.
CI first
Exits with a meaningful status code and prints machine-readable output on request.
Config optional
Sensible defaults mean BundleLens does something useful before you configure anything.
Works with your test runner
No runner lock-in; the API is a plain function you can call anywhere.
Readable reports
Terminal output for humans, JSON for everything else.
Get BundleLens v2.6
5 files • .min.js 21kb • .zip 91kb • sha384 verified
Changelog
- Import chain attribution
- CI budget checking
- Treemap rendering moved to canvas
- Reworked the public API for consistency
- Deprecated helpers removed
- Fixed a memory leak on repeated teardown
- Source maps now published with every build
// related
Related products
ChartForge
Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.
View →MotionEase
Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.
View →FormFlow
Validation and multi-step logic that works the same in React, Vue and vanilla. Your markup stays yours.
View →Wire it into CI today.
MIT licensed. Commercial friendly. Five-minute setup.