webpack 简单笔记(三)vue-cli 使用 webpack-bundle-analyzer 分析

当我们使用CommonsChunkPlugin插件时可以使用webpack-bundle-analyzer插件来分析分块是否达到我们的目地

 

安装

npm install --save-dev webpack-bundle-analyzer

使用

在webpack.config.js里的plugins里加

module.exports = {
  plugins: [
    new BundleAnalyzerPlugin()
  ]
}

最后命令行启动

webpack --profile --json > stats.json

如果你是vue-cli 就使用

npm run build --report

webpack bundle analyzer zoomable treemap

This module will help you:

  1. Realize what's really inside your bundle
  2. Find out what modules make up the most of its size
  3. Find modules that got there by mistake
  4. Optimize it!1

转载于:https://www.cnblogs.com/myzy/p/8435194.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值