内容纲要
问题描述
开发环境下,在编译中遇到了一个大问题(我和另外一个同事因为电脑配置好一些,基本没什么卡顿)。当编译项目时,需要花费很长时间进行76%的基本块优化 下面这俩地方 都会卡顿挺长时间
70% chunk graph
76% basic chunk optimization RemoveParentModulesPlugin
解决办法
配置babel-plugin-dynamic-import-node插件即可
Step1 npm安装babel-plugin-dynamic-import-node
npm install babel-plugin-dynamic-import-node
Step2 修改babel.config.js文件
module.exports = {
presets: [
'@vue/app'
],
env: {
development: {
plugins: ['dynamic-import-node']
}
}
}
参考链接:
- https://github.com/webpack/webpack/issues/6248
- https://forum.vuejs.org/t/compile-problem-76-basic-chunk-optimization-removeparentmodulesplugin/65044
- https://www.jianshu.com/p/6a3aef400584
- https://damo-web.github.io/docs/engineering/#%E6%9E%84%E5%BB%BA%E6%97%B6
- https://stackoverflow.com/questions/51380335/cannot-connect-browser-to-karma-server-permanent-page-loading
- https://juejin.cn/post/6844904098072887309