rollup-plugin-analyze
raw JSON → 0.4.0 verified Mon Apr 27 auth: no javascript maintenance
A Rollup plugin that generates an interactive HTML visualization of your bundle's module sizes and dependencies. Version 0.4.0 is the latest stable release with no active development observed since 2020. It provides a full-page visual breakdown similar to Webpack Bundle Analyzer, but as a Rollup-specific solution. Key differentiator: it outputs a standalone HTML file with drill-down capability, unlike other tools like rollup-plugin-visualizer which offers multiple output formats. Supports Rollup and Vite via plugin compatibility.
Common errors
error Error: Cannot find module 'rollup-plugin-analyze' ↓
cause Package not installed or not in node_modules.
fix
Run npm install --save-dev rollup-plugin-analyze
error TypeError: Analyze is not a function ↓
cause Incorrect import syntax: using default import where module uses named export or vice versa.
fix
Use
import Analyze from 'rollup-plugin-analyze' (default import) or const Analyze = require('rollup-plugin-analyze') for CJS. Warnings
gotcha Only supports Rollup 1.x or 2.x; no explicit support for Rollup 3+ or 4+. ↓
fix Use rollup-plugin-visualizer or fork/upgrade the plugin.
gotcha No TypeScript typings included in the package. ↓
fix Create a manual .d.ts file or ignore type errors with // @ts-ignore.
gotcha The plugin may not work with Rollup's output format 'es' or 'cjs' correctly; tested only with 'iife' in examples. ↓
fix Test with your output format; consider using a more maintained alternative like rollup-plugin-visualizer.
gotcha No configuration options exposed; Analyze() takes no arguments and uses defaults. ↓
fix If customization needed, use another plugin like rollup-plugin-visualizer or fork this one.
Install
npm install rollup-plugin-analyze yarn add rollup-plugin-analyze pnpm add rollup-plugin-analyze Imports
- default export wrong
const Analyze = require('rollup-plugin-analyze')correctimport Analyze from 'rollup-plugin-analyze'
Quickstart
// vite.config.js
import react from '@vitejs/plugin-react'
import Analyze from 'rollup-plugin-analyze'
export default () => {
return {
plugins: [react(), Analyze()]
}
}