recently when using webpack4
to configure maxAsyncRequests, I have tried many times and still don"t understand what it means. I thought it would merge when the maximum number of chunk loaded in asynchronism exceeds? The code is as follows:
entry: {
pageA: "./pageA", // utility1.js utility2.js
},
optimization: {
splitChunks: {
maxAsyncRequests: 3,
cacheGroups: {
default:false,
commons: {
chunks: "all",
minChunks: 1,
maxInitialRequests: 1, // The default limit is too small to showcase the effect
maxAsyncRequests: 3,
minSize: 0,// This is example is too small to create commons chunks,
priority:2
}
\\PageA.js
import("./pageE").then(common => {
console.log(common);
})
\\PageE.js
var utility1 = require("./utility1");
var utility2= require("./utility2");
var utility3 = require("./utility3");
pageE3utility1-33