Registry / devops / rollup-plugin-bundle-analyzer

rollup-plugin-bundle-analyzer

JSON →
library1.6.6jsnpmunverified

A Rollup plugin that visualizes the size of output files as an interactive zoomable treemap. Version 1.6.6 supports Rollup ^1.20.0 || ^2.0.0 || ^3.0.0, requires Node >=14.0.0, and ships TypeScript types. It provides multiple analyzer modes (server, static, json) and can display input, rendered (minified), and gzipped sizes. Unlike webpack-bundle-analyzer, this plugin is specifically for Rollup/Vite projects and parses minified bundles to show real module sizes. It supports excluding assets via patterns.

npm install rollup-plugin-bundle-analyzer
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-BUND
R
rollup-plugin-bundle-analyzer
devopsjavascriptv1.6.6
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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

bundleAnalyzer
import bundleAnalyzer from 'rollup-plugin-bundle-analyzer'
const bundleAnalyzer = require('rollup-plugin-bundle-analyzer')
Default export is the plugin function. CommonJS require may not work in ESM contexts; use dynamic import or import syntax.
default
import bundleAnalyzer from 'rollup-plugin-bundle-analyzer'
import { bundleAnalyzer } from 'rollup-plugin-bundle-analyzer'
The package uses default export, not named export.
type Options
import type { Options } from 'rollup-plugin-bundle-analyzer'
TypeScript types are included; Options type is available for type-checking plugin options.

Configures rollup to generate a static HTML report and a stats JSON file, excluding source maps.

// rollup.config.js import bundleAnalyzer from 'rollup-plugin-bundle-analyzer'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'esm' }, plugins: [ bundleAnalyzer({ analyzerMode: 'static', reportFilename: 'bundle-report.html', generateStatsFile: true, statsFilename: 'stats.json', excludeAssets: '*.map' }) ] };
Debug
Known issues
breakingPlugin does not work with Rollup 4.x. Only supports Rollup ^1.20.0 || ^2.0.0 || ^3.0.0.
fix
Use the official rollup-plugin-analyzer or wait for an update. Alternatively, pin rollup to version 3.x.
affects: >=4.0.0
gotchaOptions object properties are case-sensitive: 'analyzerMode', not 'mode'. 'host', not 'hostname'.
fix
Check your options object keys against the documentation.
affects: >=1.0.0
gotchaThe 'reportFilename' in 'static' mode is relative to the output directory, not the project root.
fix
Use an absolute path or ensure the relative path is correct.
affects: >=1.0.0
deprecatedSome options like 'startAutomatically' and 'openBrowser' are removed in recent versions.
fix
Remove these options. They are no longer supported.
affects: >=1.5.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-bundle-analyzer'
Package not installed or not in node_modules
fix
Run 'npm install --save-dev rollup-plugin-bundle-analyzer'
TypeError: bundleAnalyzer is not a function
Imported incorrectly (named import instead of default import).
fix
Use: import bundleAnalyzer from 'rollup-plugin-bundle-analyzer'
Error: The current Rollup version (4.x.x) is not supported by rollup-plugin-bundle-analyzer
Plugin only supports Rollup versions 1-3.
fix
Downgrade Rollup to version 3.x or use an alternative plugin.
Upgrade
Version history
1.6.6latest on npm
Audit
Dependencies
rolluprequiredpeer dependency, required to work as a plugin
Agent activity
7 hits · last 30 days
node
6
Resources
rollup-plugin-bundle-analyzer — npm install rollup-plugin-bundle-analyzer · libregistry