From dcabae4cf754228f1c428aa306e6ef43fd9014f1 Mon Sep 17 00:00:00 2001 From: Gora Kong Date: Tue, 5 Jul 2022 15:59:04 -0700 Subject: [PATCH] match limit to num shared bundles in group --- packages/bundlers/experimental/src/ExperimentalBundler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bundlers/experimental/src/ExperimentalBundler.js b/packages/bundlers/experimental/src/ExperimentalBundler.js index 972281468e9..beadae44c5a 100644 --- a/packages/bundlers/experimental/src/ExperimentalBundler.js +++ b/packages/bundlers/experimental/src/ExperimentalBundler.js @@ -1029,7 +1029,7 @@ function createIdealGraph( [...sharedToSourceBundleIds.keys()].includes(id), ); - if (bundleIdsInGroup.length > config.maxParallelRequests) { + if (sharedBundleIdsInGroup.length > config.maxParallelRequests) { // Sort the bundles so the smallest ones are removed first. let sharedBundlesInGroup = sharedBundleIdsInGroup .map(id => ({ @@ -1046,7 +1046,7 @@ function createIdealGraph( // Remove bundles until the bundle group is within the parallel request limit. for ( let i = 0; - i < bundleIdsInGroup.length - config.maxParallelRequests; + i < sharedBundleIdsInGroup.length - config.maxParallelRequests; i++ ) { let bundleToRemove = sharedBundlesInGroup[i].bundle;