Vue index.html contains <link> tags to several lazy-loaded components

后端 未结 1 779
Happy的楠姐
Happy的楠姐 2021-01-28 00:38

I\'m trying to improve the load time of my website, and towards that, I\'m using the following settings in my vue.config.js:

config.output.chunkFile         


        
1条回答
  •  耶瑟儿~
    2021-01-28 00:59

    Vue-CLI automatically sets webpackPrefetch: true for all lazy-loaded components. I do not know how you can conditionally turn it on/off so in my projects I am turning it off completely:

    // vue.config.js
      chainWebpack: config =>
      {
        config.plugins.delete('prefetch'); // for async routes
        config.plugins.delete('preload'); // for CSS
      }
    

    0 讨论(0)
提交回复
热议问题