You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -64,11 +54,6 @@ export function convertManifestToBundleGraph(
64
54
}
65
55
}
66
56
67
-
// Remove the preloader, it will already be loaded and has no dependencies
68
-
if(manifest.preloader){
69
-
deletegraph[manifest.preloader];
70
-
}
71
-
72
57
// Filter out external and non-segment dynamic imports
73
58
for(constbundleNameofObject.keys(graph)){
74
59
constbundle=graph[bundleName];
@@ -135,47 +120,13 @@ export function convertManifestToBundleGraph(
135
120
clearTransitiveDeps(deps,depName);
136
121
}
137
122
constdynDeps=newSet(bundle.dynamicImports!);
138
-
constdepProbability=newMap<string,number>();
139
123
for(constdepNameofdynDeps){
140
124
clearTransitiveDeps(dynDeps,depName);
141
-
constdep=graph[depName];
142
-
143
-
// Calculate the probability of the dependency
144
-
// Start with a 50% chance
145
-
letprobability=0.5;
146
-
// Add a 4% chance for each interactivity point (max 20%)
147
-
probability+=(dep.interactivity||0)*0.04;
148
-
149
-
// If the dependency has a segment from the same parent, it's more likely to be loaded
150
-
if(bundle.origins&&dep.origins){
151
-
for(constoriginofbundle.origins){
152
-
if(dep.origins.some((o)=>o.startsWith(origin))){
153
-
// Add a 25% chance
154
-
probability+=0.25;
155
-
break;
156
-
}
157
-
}
158
-
}
159
-
160
-
// If the dependency is a likely big import graph, it should be loaded earlier so it doesn't get blocked by smaller files, but when unlikely it should be loaded later so it doesn't block other files
0 commit comments