I just upgraded to Webpack 5 and noticed that the splitChunks are not working as they were before. Here is my code
splitChunks: {
chunks: 'all',
maxInitialRequests: Infinity,
cacheGroups: {
common: {
test: /[\\/]node_modules[\\/](@common)[\\/]/,
name: 'common',
...chunksGroupOptions
},
vendor: {
test: /[\\/]node_modules[\\/](!@common)[\\/]/,
name: 'vendors',
...chunksGroupOptions
}
}
}
The portion that no longer works is vendors. How can I get all node_modules that are not in th "@common" directory to be bundled together ? This exact snippet worked fine in Webpack 4.