vue cli3 构建多页面应用 splitChunks拆分后启动项目页面没渲染出来。

vue cli3  构建多页面应用  splitChunks拆分后启动项目页面没渲染出来。有一个这样的警告(The resource http://xx.xx.xx.xx:xxxx/js/chunk-element-ui.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.),求问题解决办法及原因。

我也遇到了同样的问题,一直是空白页+警告。
1、我的项目是多页面应用,配置了多个入口,在进行了splitChunks拆分之后,需要分别为每个页面配置chunks;单页面不用配置pages

img

img

2、如果是本地运行的话,需要先build,再运行(具体原因还在查找中······)

请问上面的兄弟解决问题了吗,我也被这个问题困住了

给多分页应用的每一个分页都添加 chunks ,并且每个chunks必须包含前三个 chunks:[分页名,'chunk-vendors','chunk-common']
如下例子:(特别是chunk-common 一定要加)

const sameChunks = [
  'chunk-vendors',
  'chunk-common',
  'chunk-ui',
  'chunk-pdfjs',
  'chunk-lodash',
  'chunk-moment',
  'chunk-html2canvas',
  'chunk-jspdf',
]
let PAGES = {
  index: {
    // page的入口
    entry: 'src/benchs/index/main.js',
    // 模板来源
    template: 'public/index.html',
    // 在dist/index.html的输出
    filename: 'index.html',
    // 当使用title选项时
    // template中的title标签需要<title><%= htmlWebpackPlugin.options.title %></title>
    title: 'xx信息化平台',
    // 在这个页面中包含的块,默认情况下会包含
    // 提取出来的通用 chunk 和 vendor chunk
    chunks: ['index', ...sameChunks],
  },

查看打包后的 index.html 中 并没有正确引用 被分割后的各个模块(每个模块超过 50000,分割成多个)。解决方法:不分割单个模块。我的情况是分割了单个模块导致的。不分割试了一下就ok了。