-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
安装插件
npm i -D webpack-bundle-analyzer
如下配置
# vue.config.js
chainWebpack: config => {
if (process.env.use_analyz) {
config
.plugin('webpack-bundle-analyzer')
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
}
}
# package.json
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"analyz": "use_analyz=true npm run build"
},
使用
npm run analyz
Metadata
Metadata
Assignees
Labels
No labels