Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.0k views
in Technique[技术] by (71.8m points)

vue-cli打包后vendor.js过大的原因?

为什么脚手架打包以后,里面的vendor文件有一兆多,我已经吧第三方的elementUI,vuex,echarts等采用cdn的方式引入了,路由也是采用懒加载的方式引入的,可还是有这么大,上线后刷新就加载特别慢,这个vendor文件夹花了七八秒钟,有什么好的方法解决吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

1.检查有没有map文件 有的话配置文件里面修改sourceMap
2.看看有没有过多的全局组件 尽量不用全局组件 单独引入


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...