If I am not mistaken, then you need disable the chunking. The relevant options are available under optimization.splitChunks.cacheGroup. If that does not work, maybe post your configuration.
On a related note, it is always a good idea to measure the difference in build time (especially if you are using the dev-server and watching for change), and the loading time in browser, before and after the said change.
Hi! I was able to reduce the files to an acceptable two bundles(app and vendors) with this configuration:
splitChunks: {
hidePathInfo: true, // prevents the path from being used in the filename when using maxSize
chunks: “all”,
// sizes are compared against source before minification
maxSize: 20000000, // splits chunks if bigger than 200k, adjust as required (maxSize added in webpack v4.15)
cacheGroups: {
default: false, // Disable the built-in groups default & vendors (vendors is redefined below)
// This is the HTTP/1.1 optimised cacheGroup configuration
vendors: { // picks up everything from node_modules as long as the sum of node modules is larger than minSize
test: /[\/]node_modules[\/]/,
name: ‘vendors’,
priority: 19,
enforce: true, // causes maxInitialRequests to be ignored, minSize still respected if specified in cacheGroup
minSize: 30000 // use the default minSize
},
vendorsAsync: { // vendors async chunk, remaining asynchronously used node modules as single chunk file
test: /[\/]node_modules[\/]/,
name: ‘vendors.async’,
chunks: ‘async’,
priority: 9,
reuseExistingChunk: true,
minSize: 10000 // use smaller minSize to avoid too much potential bundle bloat due to module duplication.
},
commonsAsync: { // commons async chunk, remaining asynchronously used modules as single chunk file
name: ‘commons.async’,
minChunks: 2, // Minimum number of chunks that must share a module before splitting
chunks: ‘async’,
priority: 0,
reuseExistingChunk: true,
minSize: 10000 // use smaller minSize to avoid too much potential bundle bloat due to module duplication.
}
}
}
What I received after bundling is: