Skip to main content
Wright Websites

bundle-pulse

gate JS and CSS bundle size

CI gate for JS/CSS bundle size: per-entry budgets on raw, gzip and brotli sizes, total JS/CSS budgets, growth vs a base-branch snapshot with content-hash-insensitive names, unminified and duplicate files.

  • 11/week on npm
  • 3★
  • MIT
  • v1.0.0
  • Web Performance
npx bundle-pulse

Read the full README on GitHub (opens in a new tab)View on npm (opens in a new tab)

bundle-pulse

From the README

Bundles grow one innocent import at a time. bundle-pulse measures every JS and CSS file in your build output the way browsers receive it (gzip and brotli as well as raw), checks each file against the budget for its glob, checks total JS and CSS, and compares against a snapshot from the base branch so a pull request that adds 40 kB to the main chunk fails with a clear message. Content hashes in file names (index-BdT9x2Qa.js, main.3f2a9c1b.chunk.js) are stripped when comparing, so the diff follows the entry, not the file name.

npx bundle-pulse dist
npx bundle-pulse dist -b 'assets/index-*.js=60KB' -b 'assets/*.css=brotli:15KB' --total-js 200KB
npx bundle-pulse dist --snapshot bundle-base.json   # on main
npx bundle-pulse dist --base bundle-base.json --max-growth 5 --format markdown

Related packages

Web Performance