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

vue打包后结果在index.html中引入了所有的chunk.js导致加载太慢

1.这个是路由,全部按照按需引入image.png
2.这个是打包后的文件image.png
3.这个是在登陆页面的时候,结果所有chunk都加载了
image.png

问题:如何是需要哪个js文件再加载哪个js文件,或者需要vue.config.js中配置什么?


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

1 Answer

0 votes
by (71.8m points)

如果你用的是 vue-cli默认的配置, 那就没错, 这些多加载的js都是prefetch的 并不会影响你首页加载的速度的,


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

...