In my webpack config I created 2 cache groups, "vendors" and "common".
entry: {
'entry1': './src/entry1.js',
'entry2_independent': './src/entry2_independent.js',
},
optimization: {
splitChunks: {
cacheGroups: {
vendors: {
minChunks: 30,
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
priority: -10,
chunks: 'initial'
},
default: {
minChunks: 30,
priority: -20,
chunks: 'initial',
reuseExistingChunk: true,
name: 'common'
}
}
}
},
I want one of my entry points to be independent. It should include all its dependencies without being depndent on common.js or vendors.js.
To be more specific, I want all entry points with '_independent' in their name, to be independent.
I still want to preserve the optimization logic. If a module is used in 30 chunks, I still want it to be part of the 'common' layer.
How can I do it?
Thanks!