码迷,mamicode.com
首页 > Web开发 > 详细

webpack SplitChunksPlugin 配置参数

时间:2019-05-30 16:11:36      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:web   0kb   优先   div   加载   existing   文件名   字节   efault   

//https://www.webpackjs.com/plugins/split-chunks-plugin/
// 代码分割
splitChunks: { chunks: "all", // async: 打包异步引入的代码块 all: 同步、异步 initial: 同步代码 minSize: 30000, // 字节 超出30kb的代码块 minChunks: 1, // 模块被使用次数 maxAsyncRequests: 5, // 同时加载的模块数 最多打包出的个数 maxInitialRequests: 3, // 首页 或 入口处 automaticNameDelimiter: ‘~‘, // name: true, cacheGroups: { // 缓存组 vendors: { // vendors: false 打包的文件名不再添加vendors test: /[\\/]node_modules[\\/]/, // 匹配规则 priority: -10, // 优先级
       filename: ‘vendors.js‘ },   default: { // default: false minChunks: 2, priority: -20, reuseExistingChunk: true, // 一个模块被打包过,不会重复打包
       filename: ‘common.js‘ } } }

  

webpack SplitChunksPlugin 配置参数

标签:web   0kb   优先   div   加载   existing   文件名   字节   efault   

原文地址:https://www.cnblogs.com/tengrl/p/10949982.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!