标签:bundle require conf oca 端口 webpack nbsp pac npm
首先需要安装webpack-bundle-analyzer插件
npm install webpack-bundle-analyzer --save-dev
然后在config.js中配置
module.exports = { chainWebpack: config => { config .plugin(‘webpack-bundle-analyzer‘) .use(require(‘webpack-bundle-analyzer‘).BundleAnalyzerPlugin) } }
运行命令
npm run serve
也可以在打包时运行
npm run build --report
效果:
localhost:8888是固定端口,本地不要占用即可正常访问
略。。。之后就弹出窗口了
。
标签:bundle require conf oca 端口 webpack nbsp pac npm
原文地址:https://www.cnblogs.com/fqh123/p/12106673.html