SplitChunksPlugin configuration items for webpack4

SplitChunksPlugin"s configuration item maxInitialRequests defaults to 3 and maxAsyncRequests defaults to 5

my understanding is that a module, in the whole packaging process, if the maximum number of Synchronize import is 3 and the maximum number of asynchronous import is 5, it will be packaged separately in a separate file.

doubt: shouldn"t it be the minimum number of times? MinInitialRequests and minAsyncRequests.

the more modules a module depends on, the more necessary it is to be packaged into a separate file, isn"t it?

Mar.14,2021

although time has passed, I still write my own thoughts

maxInitialRequests : this is the number of script js references in the template file index.html , excluding runtime.bundle.js generated by optimization.runtimeChunk . If there are more, there will be more requests for additional downloads, which may not be cost-effective. You can set it to 1 to see the effect.

send out an online tool site by the way: programmer navigation

Menu