1

单页面时没问题,改为多页面后运行页面空白,控制台提示:
The resource http://localhost:6255/runtime~index.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
image.png
我的vue.config.js文件入口配置
image.png

参考了一些网上的文章,发现有出现相同的情况。然后与其他文章对比发现图一框框中的文件名大多是不一样的,借鉴他们的修改方法,在chunks 里添加我控制台提示的文件
image.png
然后npm run dev重新运行,问题解决,后来发现vue.config.js文件里有这个配置,把他注释掉也可以解决问题
image.png

总结:各位如果遇到类似情况可以尝试在chunk:[]中添加控制台提示的那个文件,原理不太懂,如果有知道的大佬可以在评论区评论,谢谢
参考:(https://github.com/vuejs/vue-...,(https://segmentfault.com/q/10...


Goodname
4 声望0 粉丝