rollup-plugin-summary is a Rollup plugin that generates a concise summary of the build output, including file sizes, gzipped sizes, minified sizes, and Brotli compressed sizes. It helps developers monitor the size impact of their bundles. The current stable version is 3.0.1. The package maintains an active release cadence, with major versions often released to align with new major versions of Rollup itself, ensuring compatibility and leveraging new features. Key differentiators include its simplicity, clear output format, and configurable options for hiding specific size metrics, providing a focused overview of bundle characteristics without overwhelming detail. It is primarily used within the Rollup build ecosystem to provide quick feedback on asset sizes.
npm install rollup-plugin-summaryVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate `rollup-plugin-summary` into a basic Rollup configuration, showing common options.
Upgrade your Rollup dependency to `^3.0.0||^4.0.0` and Node.js to `^20.9.0` or higher. Alternatively, pin `rollup-plugin-summary` to `^2.0.0` if unable to upgrade Rollup/Node.js.
If using Rollup v3, upgrade to `rollup-plugin-summary` v2.x. If using Rollup v2, ensure `rollup-plugin-summary` is pinned to `^1.4.3` or earlier.
For each Rollup build or configuration, ensure you create a new instance of the plugin: `plugins: [summary()]` rather than reusing a globally defined plugin instance. This issue was fixed in v3.0.1.
Ensure your Node.js environment is at least version 14.x. For newer versions (v3.0.0+), Node.js v20 or higher is required.
Ensure `summary` is imported correctly and called as a function: `plugins: [summary()]`.
Change `const summary = require('rollup-plugin-summary');` to `const summary = require('rollup-plugin-summary').default;`.The plugin needs to be instantiated as a function call: `plugins: [summary()]`.