Prints gzipped sizes of Rollup bundle assets and tracks changes since last build. Version 0.3.1 is the latest release, with low maintenance. It is a port of Google Chrome Labs' size-plugin for Webpack, providing per-file size comparison and historical tracking via a stored .size-snapshot.json file. Key differentiator: integrates directly into Rollup's output lifecycle.
npm install rollup-plugin-sizeVerified import paths — ran on the pinned version, not inferred.
Basic Rollup configuration using rollup-plugin-size to print gzipped sizes of output files.
Set the 'filename' option to a custom path or add .size-snapshot.json to .gitignore.
Remove the 'profile' option from plugin configuration.
Install Rollup via `npm install --save-dev rollup`.
Commit the .size-snapshot.json file to version control if you want persistent change tracking across builds.
Use `import size from 'rollup-plugin-size'` (default import).
Run `npm install --save-dev rollup-plugin-size`.