webpack-bundle-analyser
raw JSON → 1.4.0 verified Sat Apr 25 auth: no javascript
Webpack Bundle Analyser is a tool for analysing Webpack bundle output, forked from the official Webpack analyse website. Version 1.4.0 is the latest stable release, but the project appears to be in early development with an incomplete todo list including open browser after compiling, better error handling, and graph viewing improvements. It allows local or CI-based bundle analysis by generating a stats file and producing a static HTML report. Differentiators from alternatives like webpack-bundle-analyzer include a different UI and the ability to run without a plugin by using webpack --profile --json. However, it lacks the interactive treemap visualization and active maintenance of its alternative.
Common errors
error Error: Cannot find module 'webpack-bundle-analyser' ↓
cause Package not installed or not in PATH
fix
Run npm install webpack-bundle-analyser --save-dev or use npx
error Error: build is not a valid command ↓
cause The build subcommand is required but omitted
fix
Use syntax: webpack-bundle-analyser build -o output -d data.json
Warnings
gotcha The package is not actively maintained; last release was in 2018. The todo list indicates incomplete features. ↓
fix Consider using webpack-bundle-analyzer instead, which is actively maintained.
gotcha The CLI command requires a build subcommand; running without it does nothing. ↓
fix Use webpack-bundle-analyser build -o <output> -d <stats.json>
Install
npm install webpack-bundle-analyser yarn add webpack-bundle-analyser pnpm add webpack-bundle-analyser Imports
- webpack-bundle-analyser (CLI) wrong
webpack-bundle-analyser (without arguments)correctnpx webpack-bundle-analyser build -o dist -d data.json
Quickstart
// 1. Generate webpack stats file
webpack --profile --json > data.json
// 2. Run the analyser
npx webpack-bundle-analyser build -o dist -d data.json
// 3. Serve the output (e.g., with npx serve)
npx serve dist