A Rollup plugin that displays the size of output files in the CLI, including minified, gzipped, and Brotli sizes. Version 10.0.0 is the latest stable, requiring Node >=16 and Rollup >=4 (ESM-only). It offers customizable output formatting, a reporter API for custom handlers (e.g., badge generation), and experimental size comparisons against previous releases or builds. Differentiates from alternative size plugins with built-in Brotli support and theme-aware display.
npm install rollup-plugin-filesizeVerified import paths — ran on the pinned version, not inferred.
Shows how to integrate the plugin into a Rollup build, displaying minified and gzipped sizes.
Use import syntax and ensure Node >=16.
If minification is needed, use a separate plugin like @rollup/plugin-terser.
Replace 'render' with 'reporter' option.
Check console output for per-file sizes; aggregate manually if needed.
Use v8.0.1 or later on Windows.
Do not rely on it for production use.
Use import syntax instead of require().
Use import filesize from 'rollup-plugin-filesize'.
Run npm install rollup-plugin-filesize --save-dev.