一,作用
将打包的项目以可视化的形式展现到浏览器上,并展示打包项目的名称大小等
二,安装
yarn add webpack-bundle-analyzer
三,使用
在终端执行 ng build --help 可以看到参数--stats-json 作用是生成stats.json
在项目的package.json
"build:with:stats": "node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build xxx --prod --stats-json", "analyzer": "webpack-bundle-analyzer dist/xxx/stats.json",
在终端: 生成stats.json 运行 CLI 工具
yarn build:with:stats
yarn analyzer
用谷歌浏览器打开
浙公网安备 33010602011771号