Rollup plugin that prints detailed bundle analysis metrics to the console, including bundle size, original size, code reduction percentage, module count, and per-file breakdown with rendered size, original size, relative contribution, and dependents. Version 4.0.0 supports Rollup 2.x/3.x. Outputs formatted tables and optional summary-only view. Useful for CI gating via onAnalysis callback. Differentiators include zero dependencies, optional CI integration, and summaryOnly mode for concise output.
npm install rollup-plugin-analyzerVerified import paths — ran on the pinned version, not inferred.
Configure rollup-plugin-analyzer with summary-only output, limiting to top 10 modules, filtering out node_modules, and calling onAnalysis callback for custom reporting.
Upgrade to Rollup 2.x or later, or pin to rollup-plugin-analyzer@3.x.
Read documentation: rendered size is post-tree-shaking; original size is before.
Use `input` and `output` per Rollup 1.x+ API. Example in README may be outdated.
Rename config to rollup.config.mjs or use createRequire from 'module'.
Use import instead of require() in your rollup config, or rename file to .cjs.
Use: import analyze from 'rollup-plugin-analyzer' (no braces).
Run: npm install --save-dev rollup-plugin-analyzer
No dependency data recorded yet.