@@ -429,7 +429,10 @@ impl CodeSplitter {
429
429
fn analyze_module_graph (
430
430
& mut self ,
431
431
compilation : & mut Compilation ,
432
- prepared_outgoings : & IdentifierMap < IdentifierIndexMap < Vec < ModuleGraphConnection > > > ,
432
+ prepared_outgoings : & IdentifierMap < (
433
+ IdentifierIndexMap < Vec < ModuleGraphConnection > > ,
434
+ Vec < AsyncDependenciesBlockIdentifier > ,
435
+ ) > ,
433
436
) -> Result < Vec < CreateChunkRoot > > {
434
437
// determine runtime and chunkLoading
435
438
let mut entry_runtime: std:: collections:: HashMap < & str , RuntimeSpec , rustc_hash:: FxBuildHasher > =
@@ -765,7 +768,10 @@ impl CodeSplitter {
765
768
runtime : & RuntimeSpec ,
766
769
module_graph : & ModuleGraph ,
767
770
module_graph_cache : & ModuleGraphCacheArtifact ,
768
- prepared_outgoings : & IdentifierMap < IdentifierIndexMap < Vec < ModuleGraphConnection > > > ,
771
+ prepared_outgoings : & IdentifierMap < (
772
+ IdentifierIndexMap < Vec < ModuleGraphConnection > > ,
773
+ Vec < AsyncDependenciesBlockIdentifier > ,
774
+ ) > ,
769
775
) -> ( Vec < ModuleIdentifier > , Vec < AsyncDependenciesBlockIdentifier > ) {
770
776
if let Some ( ref_value) = self
771
777
. module_deps
@@ -776,15 +782,12 @@ impl CodeSplitter {
776
782
return ( ref_value. 0 . clone ( ) , ref_value. 1 . clone ( ) ) ;
777
783
}
778
784
779
- let outgoings = prepared_outgoings
785
+ let ( outgoings, blocks ) = prepared_outgoings
780
786
. get ( module)
781
787
. expect ( "should have outgoings" ) ;
782
- let m = module_graph
783
- . module_by_identifier ( module)
784
- . expect ( "should have module" ) ;
785
788
786
789
let mut modules = IdentifierIndexSet :: default ( ) ;
787
- let mut blocks = m . get_blocks ( ) . to_vec ( ) ;
790
+ let mut blocks = blocks . clone ( ) ;
788
791
789
792
' outer: for ( m, conns) in outgoings. iter ( ) {
790
793
for conn in conns {
@@ -802,8 +805,8 @@ impl CodeSplitter {
802
805
module_graph_cache,
803
806
prepared_outgoings,
804
807
) ;
805
- modules. extend ( extra_modules. iter ( ) . copied ( ) ) ;
806
- blocks. extend ( extra_blocks. iter ( ) . copied ( ) ) ;
808
+ modules. extend ( extra_modules) ;
809
+ blocks. extend ( extra_blocks) ;
807
810
}
808
811
crate :: ConnectionState :: Active ( false ) => { }
809
812
crate :: ConnectionState :: CircularConnection => { }
@@ -1048,7 +1051,10 @@ impl CodeSplitter {
1048
1051
fn prepare_outgoings (
1049
1052
& self ,
1050
1053
compilation : & Compilation ,
1051
- ) -> IdentifierMap < IdentifierIndexMap < Vec < ModuleGraphConnection > > > {
1054
+ ) -> IdentifierMap < (
1055
+ IdentifierIndexMap < Vec < ModuleGraphConnection > > ,
1056
+ Vec < AsyncDependenciesBlockIdentifier > ,
1057
+ ) > {
1052
1058
let module_graph = compilation. get_module_graph ( ) ;
1053
1059
let modules = module_graph. modules ( ) . keys ( ) . copied ( ) . collect :: < Vec < _ > > ( ) ;
1054
1060
modules
@@ -1058,7 +1064,7 @@ impl CodeSplitter {
1058
1064
let m = module_graph
1059
1065
. module_by_identifier ( & mid)
1060
1066
. expect ( "should have module" ) ;
1061
-
1067
+ let blocks = m . get_blocks ( ) . to_vec ( ) ;
1062
1068
m. get_dependencies ( )
1063
1069
. iter ( )
1064
1070
. filter ( |dep_id| {
@@ -1072,7 +1078,7 @@ impl CodeSplitter {
1072
1078
. map ( |conn| ( conn. module_identifier ( ) , conn) )
1073
1079
. for_each ( |( module, conn) | outgoings. entry ( * module) . or_default ( ) . push ( conn. clone ( ) ) ) ;
1074
1080
1075
- ( mid, outgoings)
1081
+ ( mid, ( outgoings, blocks ) )
1076
1082
} )
1077
1083
. collect :: < IdentifierMap < _ > > ( )
1078
1084
}
0 commit comments