Registry / devops / rollup-plugin-visualizer

rollup-plugin-visualizer

JSON →
library7.0.1jsnpmunverified

rollup-plugin-visualizer v7.0.1 is a Rollup plugin that generates interactive visualizations (treemap, sunburst, network, raw-data) to analyze bundle composition and module size distribution. Requires Node >=22 and supports Rollup 2-4 and Rolldown 1.x. Unlike bundle-size analysis tools, it offers multiple visualization types and works at build time. Actively maintained with frequent releases.

npm install rollup-plugin-visualizer
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-VISU
R
rollup-plugin-visualizer
devopsjavascriptv7.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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

visualizer
import { visualizer } from 'rollup-plugin-visualizer'
const visualizer = require('rollup-plugin-visualizer')
ESM-only since v6; CommonJS require will fail. TypeScript types included.
PluginVisualizerOptions
import type { PluginVisualizerOptions } from 'rollup-plugin-visualizer'
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer'
Type export; use import type to avoid runtime inclusion.
default (deprecated)
import visualizer from 'rollup-plugin-visualizer'
const visualizer = require('rollup-plugin-visualizer')
Default import works, but named import is preferred and more explicit.

Rollup config with visualizer plugin generating treemap HTML report with gzip/brotli sizes.

// rollup.config.js import { visualizer } from 'rollup-plugin-visualizer'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'esm' }, plugins: [ visualizer({ filename: 'stats.html', title: 'Bundle Analysis', open: true, template: 'treemap', gzipSize: true, brotliSize: true, sourcemap: false }) ] };
Debug
Known issues
breakingESM-only: This package requires Node >=22 and does not support CommonJS require()
fix
Use import syntax and ensure project is configured for ESM (e.g., 'type': 'module' in package.json)
affects: >=6.0.0
breakingPeer dependency rollup updated to require Rollup 2.x, 3.x, or 4.x only
fix
Update rollup to version 2, 3, or 4, or use an older version of the plugin
affects: >=7.0.0
breakingPlugin option 'open' default changed from false to true in v5
fix
Explicitly set { open: false } if you do not want the browser to open automatically
affects: >=5.0.0
deprecatedThe option 'treeshake' is deprecated and will be removed in a future version
fix
Use the 'sourcemap' option instead or configure Rollup's treeshaking directly
affects: >=7.0.0
gotchaPlugin must be applied after other plugins that modify the bundle (e.g., terser), otherwise sizes may be inaccurate
fix
Place visualizer last in the plugins array to capture final bundle sizes
affects: *
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using CommonJS require() to import an ESM-only package
fix
Switch to import syntax or use dynamic import: const visualizer = (await import('rollup-plugin-visualizer')).visualizer;
TypeError: visualizer is not a function
Default import used but package exports named export; or wrong import path
fix
Use named import: import { visualizer } from 'rollup-plugin-visualizer'
Error: Package 'rollup' must be installed to use this plugin
Missing peer dependency
fix
Install rollup: npm install rollup
Error: Template 'circlepacking' is not available. Available templates: treemap, sunburst, network, raw-data
Misspelled or unsupported template name
fix
Use one of the supported templates: treemap, sunburst, network, raw-data
Upgrade
Version history
7.0.1latest on npm
Audit
Dependencies
rolluprequiredPeer dependency required to function as a Rollup plugin
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-visualizer — npm install rollup-plugin-visualizer · libregistry