为了账号安全,请及时绑定邮箱和手机立即绑定

请问nuxt.js项目打包后vendor.js过大怎么处理 ?

请问nuxt.js项目打包后vendor.js过大怎么处理 ?

沧海一幻觉 2018-07-26 12:10:58
nuxt.js项目打包后vendor.js过大怎么处理 ?????
查看完整描述

3 回答

?
慕粉21210115

TA贡献1条经验 获得超0个赞

nuxt.config.js 在build中添加 

build:{
   optimization: { 
       splitChunks: {        
           chunks: 'all',
           automaticNameDelimiter: '.',
           maxAsyncRequests: 7,       
           cacheGroups: {          
               vuetify: {           
                   test: /node_modules[\\/]vuetify/,            
                   chunks: 'all',            
                   priority: 20,            
                   name: true          
                },          
                elementui: {            
                    test: /node_modules[\\/]element-ui/,           
                    chunks: 'all',           
                    priority: 20,            
                    name: true          
                 }       
            }      
        }
   }
}


查看完整回答
反对 回复 2019-10-23
?
乡兵1997

TA贡献1条经验 获得超0个赞

请问找到解决办法了吗?我最近也碰到这个问题

查看完整回答
反对 回复 2018-11-08
  • 3 回答
  • 1 关注
  • 6884 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信