惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
月光博客
月光博客
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
人人都是产品经理
人人都是产品经理
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
The Cloudflare Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
Last Week in AI
Last Week in AI

时间的朋友

Windows 命令行密码重置 Anaconda安装 typescript 注解解读1 Konvajs Shape加载自定义图片 sshpass 使用 why-is-node-running webgl笔记 SharedArrayBuffer is not defined blender 常用快捷键 | 时间的朋友 vue -- v3.4commit提交记录2 vue2 升级vue3报错问题整理 着色器 expressjs 源码 hyper-V arch linux 网络配置 element input数字格式化 three 拼接货架 WebAudio笔记 Windows nginx重启bat脚本 vue -- v3.4commit提交记录 URI malformed vue3 -- Class 对象在组件中使用范例 | 时间的朋友 ruby 安装和升级 element-plus 老版本cascader使用卡死问题 vue3 内置Transition组件 | 时间的朋友 前端memo的实现 | 时间的朋友 Vue -- vue-class-component源码 | 时间的朋友 linux 优化脚本 typescript 装饰器 | 时间的朋友 microbundle 源码 | 时间的朋友 WSL2问题解决WslRegisterDistribution failed with error: 0x800701bc
webpack 代码分片 | 时间的朋友
2022-05-22 · via 时间的朋友

Published: · LastMod: May 24, 2022 · 214 words

webpack CommonsChunkPlugin 🔗

代码分片是webpack中重要的优化手段,对于一个比较大的chunk,有必要提取出当前chunk中依赖的不经常变化的库

usage 🔗

1
new webpack.optimize.CommonsChunkPlugin()

配置项 🔗

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
	 name: string, // 提取出来的chunk的名称
   names: string[], // 名称输入字符串数组时,相当于多次调用本插件
   filename: string, // 
   minSize: number,
   minChunks: number|Infinity|function(module, count) => boolean, // 最少引用次数
   chunks: string[], // 这里的chunks, 和入口部分的chunk一一对应,如果出现在其中,就会被单独提取出来,如果省略,即所有入口chunk都会被选择
   children: boolean,
   deepChildren: boolean,
   async: boolean|string,
}