I have the following configuration in webpack config for split chunks. This perfectly creates two bundles vendors (node modules that were imported in initial files) and common(node modules that were imported in the lazy-loaded components)
splitChunks: {
name: true,
cacheGroups: {
default: false,
vendors: false,
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
chunks: "initial"
},
common: {
test: /[\\/]node_modules[\\/]/,
name: "common",
minChunks: 2,
chunks: "async",
priority: 10,
reuseExistingChunk: true,
enforce: true
}
}
},
Question- But there are some node modules that I do not want to be included in any of the bundles. Neither the above two nor the main bundles but to be created separately alone.
import('lodash')
should create a lodash.chunk.js.
import('underscore')
should create a underscore.chunk.js.
Can I do it thought the magic comments? /* webpackIgnore: true*/