webpack-bundle-analyzer
可视化分析包大小插件
1.npm install webpack-bundle-analyzer --save-dev
安装
2. 修改webpack.config.js
文件
// 引入
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
plugins: [
// 开启 BundleAnalyzerPlugin
new BundleAnalyzerPlugin(),
],
};
npm run build
打包文件后会自动打开http://127.0.0.1:8888/
该地址即可查看
Comments | NOTHING