vue项目本地调试没有问题;项目打包后首屏进入白屏,控制台无报错,只有网络里面chunk-vendors.7a4ba0cd.js报的404;并且无论是ie还是谷歌等其他浏览器都偶尔会遇到这个问题;有人知道原因吗
可能是你的index.html没有设置更新缓存,导致你打包之后还是请求之前的js文件导致的,
index.html:
<meta http-equiv="pragram" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="expires" content="0">
vue.config.js
configureWebpack: (config) => {
config.output.filename = `js/[name]-[hash:8].js?ver=${timestamp}`;
config.output.chunkFilename = `js/[name].js?ver=${timestamp}`;}
可能是 chunk-vendors文件体积过大 ,加载时间延迟,没有其他chunk先返回内容,导致白屏