Skip to content

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.

★ 8.3kGitHub
↓ 8.8k / week● MIT● TS 5.0+
bundlelens-preview.png
Abstract preview graphic for BundleLens

// 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.

● 0 deps● 18ms cold start● CI ready

// 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

v2.6 Dec 9 2025 • latest
  • Import chain attribution
  • CI budget checking
  • Treemap rendering moved to canvas
v2.5.4 Oct 5 2025
  • Reworked the public API for consistency
  • Deprecated helpers removed
v2.5.3 Aug 1 2025
  • Fixed a memory leak on repeated teardown
  • Source maps now published with every build
View full archive →

// related

Related products

Sep 10 • v2.0

ChartForge

Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.

View →
Aug 30 • v3.2.1

MotionEase

Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.

View →
Aug 19 • v1.9.4

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.