A webpack plugin that generates an interactive treemap visualization of your bundle's composition, showing which modules contribute to chunk sizes. Current stable version is 2.0.0, specifically forked from the abandoned webpack-visualizer-plugin to add webpack 5 support. Releases are sporadic. Differentiators: simple setup, outputs a standalone HTML file, and provides granular module-level breakdown within chunks. Alternative tools like webpack-bundle-analyzer offer similar functionality with more interactive features.
npm install webpack-visualizer-plugin2Verified import paths — ran on the pinned version, not inferred.
Shows ESM import and plugin instantiation with output filename and chunk modules option.
Use path.join('..', 'stats', 'statistics.html') if output.path is 'dist', to place stats in project root/stats.Use webpack-visualizer-plugin (v1) for webpack 4 or migrate to webpack 5.
Ensure Node.js version is at least 5; no other concerns.
Check updated options: first argument is an object with filename and throwOnError; second is chunkModules.
Consider alternative tools like webpack-bundle-analyzer for large projects.
npm install webpack-visualizer-plugin2 --save-dev
Use const Visualizer = require('webpack-visualizer-plugin2').default; or switch to ESM import.Upgrade webpack to version 5 or use the original webpack-visualizer-plugin.
Ensure webpack config excludes the output stats path from being processed by loaders.