进行打包分析

webpack.analysis.js

const { merge } = require('webpack-merge')
const commonConfig = require('./webpack.common')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')

const prodConfig = {
  mode: 'production',
  devtool: 'cheap-module-source-map',
  plugins: [new BundleAnalyzerPlugin()],
}

module.exports = merge(commonConfig, prodConfig)

package.json

{
  "scripts": {
    "analysis": "webpack --config ./build/webpack.analysis.js"
  },
}

posted on 2021-09-10 10:44  aisowe  阅读(77)  评论(0编辑  收藏  举报

导航