进行打包分析

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"
  },
}

进行打包分析

上一篇:WPF之X名称空间详解


下一篇:多功能文本工具