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
688 views
in Technique[技术] by (71.8m points)

vux 按需引入,但是vue-cli打包后感觉会把很多没用到的组建打包进vendor.js和 app.js

vux 按需引入,但是vue-cli打包后感觉会把很多没用到的组建打包进vendor.js和 app.js ,使我的2个JS都很大,接近500KB了,请问有老司机遇到这个问题并解决吗? 环境是 vue-cli + vux.
图片描述

实际上我很多都没用到,特别是地址那2个json。


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

1 Answer

0 votes
by (71.8m points)

建议用webpack2.0里面加入啦tree-shaking 优化,对题主应该有帮助,我司升级到2.0以后,减少啦155多kb


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

...