With a splitChunks.cacheGroup.test setting you are able to put desired packages in one single chunk, which are resolved by your declared function (module, chunk):boolean | RegExp | string
value.
For example let's say there is a valid splitChunks definition without cacheGroup section. Webpack build will output 10 chunks but you desire to cache some of the node_modules packages into single chunk (react, react-dom, lodash). With definition like so you will be able to do it:
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/](react|react-dom|lodash)[\\/]/,
name: 'vendor',
chunks: 'all',
}
}
These section will not interrupt other chunks split.