1、
//安装
cnpm intall webpack-bundle-analyzer –save-dev


2、
// vue.config.js

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
configureWebpack: config => {
    if (process.env.NODE_ENV === 'production') {
      return {
        plugins: [
          new BundleAnalyzerPlugin()
        ]
      }
    }
  }

3、
// package.json
 "analyz": "npm_config_report=true npm run build"

4、
npm run analyz    //默认8888  端口

Logo

前往低代码交流专区

更多推荐