[Vue CLI 3] 配置 webpack-bundle-analyzer 插件
1、//安装cnpm intall webpack-bundle-analyzer –save-dev2、// vue.config.jsconst BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPluginconfigureWebpack: config => {...
·
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 端口
更多推荐
已为社区贡献4条内容
所有评论(0)