Skip to content

v0.1.0 β€” Initial release

Choose a tag to compare

@shiftEscape shiftEscape released this 21 Mar 13:25
· 26 commits to main since this release

πŸŽ‰ Initial release

astro-bundle-budget is an Astro integration that audits your JS and CSS bundle sizes at build time β€” and optionally fails the build when you exceed your thresholds.

Features

  • Per-file budgets β€” set size limits on individual assets using glob patterns
  • Per-page budgets β€” limit the total JS/CSS payload a single page may reference
  • Compression-aware β€” measure gzip or brotli wire sizes instead of raw bytes
  • Dev Toolbar panel β€” live bundle stats visible inside astro dev
  • JSON report β€” write bundle-budget-report.json to outDir for CI artefact diffing
  • Zero runtime dependencies β€” Node built-ins only

Install

npm install -D astro-bundle-budget

Usage

// astro.config.mjs
import bundleBudget from 'astro-bundle-budget'

export default defineConfig({
  integrations: [
    bundleBudget({
      budgets: [
        { path: 'assets/vendor-*.js', budget: '50 kB' },
        { path: '**/*.js',            budget: '100 kB' },
        { path: '**/*.css',           budget: '20 kB' },
      ],
    })
  ]
})

Links