webpack SplitChunksPlugin 配置参数

//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' } } }

  

转载于:https://www.cnblogs.com/tengrl/p/10949982.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值