Registry / devops / rollup-plugin-summary

rollup-plugin-summary

JSON →
library3.0.1jsnpmunverified

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-summary
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-SUMM
R
rollup-plugin-summary
devopsjavascriptv3.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

summary
import summary from 'rollup-plugin-summary';
import { summary } from 'rollup-plugin-summary';
This package uses a default export for the plugin factory function.
SummaryPluginOptions
import summary, { type SummaryPluginOptions } from 'rollup-plugin-summary';
Import types separately using `import type` for TypeScript projects.
summary
const summary = require('rollup-plugin-summary').default;
const summary = require('rollup-plugin-summary');
For CommonJS environments, the default export needs to be accessed via `.default`.

This quickstart demonstrates how to integrate `rollup-plugin-summary` into a basic Rollup configuration, showing common options.

import summary from 'rollup-plugin-summary'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'es', }, plugins: [ summary({ showBrotliSize: true, // Optionally show brotli size showGzippedSize: true, // Optionally show gzipped size showMinifiedSize: true, // Optionally show minified size showWarnings: true // Show warnings related to bundle sizes }) ], };
Debug
Known issues
breakingVersion 3.0.0 drops support for Rollup v2 and Node.js versions prior to v20. Users on older environments must upgrade Rollup and Node.js or remain on `rollup-plugin-summary` v2.x.
fix
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.
affects: >=3.0.0
breakingVersion 2.0.0 was released to specifically support Rollup v3. Users of Rollup v2 should remain on `rollup-plugin-summary` v1.x.
fix
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.
affects: >=2.0.0 <3.0.0
gotchaReusing a single instance of the summary plugin across multiple Rollup builds (e.g., in a watch mode or multi-config setup) can lead to duplicate summary output due to internal state retention.
fix
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.
affects: >=1.2.3 <3.0.1
breakingMinimum required Node.js version was bumped to 14 in v1.4.0, which may affect older build environments.
fix
Ensure your Node.js environment is at least version 14.x. For newer versions (v3.0.0+), Node.js v20 or higher is required.
affects: >=1.4.0 <3.0.0
Errors
Common errors & fixes
Error: The 'plugins' option must be an Array, a function that returns an Array, or null.
Incorrect plugin configuration, often due to an invalid import or not calling the plugin factory.
fix
Ensure `summary` is imported correctly and called as a function: `plugins: [summary()]`.
TypeError: Cannot read properties of undefined (reading 'default')
Attempting to `require` the plugin in a CommonJS environment without accessing the `.default` export.
fix
Change `const summary = require('rollup-plugin-summary');` to `const summary = require('rollup-plugin-summary').default;`.
Plugin 'rollup-plugin-summary' (rollup-plugin-summary) must be a function.
Attempting to use the plugin import directly in the plugins array without calling it.
fix
The plugin needs to be instantiated as a function call: `plugins: [summary()]`.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
rolluprequiredPeer dependency for Rollup, required to function as a Rollup plugin.
Agent activity
15 hits · last 30 days
node
10
OpenAI (training)
3
Bingbot
1
Resources
rollup-plugin-summary — npm install rollup-plugin-summary · libregistry