Webpack plugin and CLI that generates an interactive zoomable treemap visualization of bundle contents, showing module sizes (stat, parsed, gzip). Current stable version is 4.4.2 (2023). A fork of webpack-contrib/webpack-bundle-analyzer by the UmiJS team. Actively maintained with regular releases. Supports both ESM and CJS imports. Key differentiator: designed to work seamlessly with UmiJS framework but also compatible with any Webpack project. Provides server, static, JSON, and disabled modes for flexible integration.
npm install umi-webpack-bundle-analyzerVerified import paths — ran on the pinned version, not inferred.
Shows how to use the plugin in a webpack config to generate a static HTML report and stats JSON file.
Change 'import BundleAnalyzerPlugin from ...' to 'import { BundleAnalyzerPlugin } from ...'.Use 'openAnalyzer' instead (default true).
Update to umi-webpack-bundle-analyzer@4.2.0 or later.
Upgrade Node.js to at least 10.13.0.
Set 'output.path' in webpack config to a writable directory.
new BundleAnalyzerPlugin({}) or provide at least one option.Use const { BundleAnalyzerPlugin } = require('umi-webpack-bundle-analyzer') or import { BundleAnalyzerPlugin } from ...Run 'npm install --save-dev umi-webpack-bundle-analyzer' or 'yarn add -D umi-webpack-bundle-analyzer'.
Install webpack: 'npm install --save-dev webpack@4' (or 5 compatible).