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-visualizerVerified import paths — ran on the pinned version, not inferred.
Rollup config with visualizer plugin generating treemap HTML report with gzip/brotli sizes.
Use import syntax and ensure project is configured for ESM (e.g., 'type': 'module' in package.json)
Update rollup to version 2, 3, or 4, or use an older version of the plugin
Explicitly set { open: false } if you do not want the browser to open automaticallyUse the 'sourcemap' option instead or configure Rollup's treeshaking directly
Place visualizer last in the plugins array to capture final bundle sizes
Switch to import syntax or use dynamic import: const visualizer = (await import('rollup-plugin-visualizer')).visualizer;Use named import: import { visualizer } from 'rollup-plugin-visualizer'Install rollup: npm install rollup
Use one of the supported templates: treemap, sunburst, network, raw-data