一、安装
npm install webpack-bundle-analyzer --save-dev
二、配置
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; module.exports = { plugins: [ new BundleAnalyzerPlugin(), ], };
三、启动
npx webpack --config webpack.config.analyzer.js