由于chunk-vendors过大,于是想通过设置optimization.splitChunks拆分一下大的js文件,但是设置后导致页面一片空白,配置如下:
控制台警告:
The resource <URL> 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.
点开后有16个类似的警告
the resource http://localhost:8087/npm.vuex.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.
The resource http://localhost:8087/npm.vue.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.
后来看到了这个 //www.greatytc.com/p/78ca0d36b99d 受到启发,于是我到vue-cli 的文档上找到了这个
将所有警报的chunks都添加上,配置如下
重启!页面正常显示了!!!