@@ -960,6 +960,9 @@ impl Compilation {
960960 for removed_chunk in removed_chunks {
961961 self . chunk_render_results . remove ( & removed_chunk) ;
962962 }
963+ self
964+ . chunk_render_results
965+ . retain ( |chunk, _| self . chunk_by_ukey . contains ( chunk) ) ;
963966 mutations. get_affected_chunks_with_chunk_graph ( self )
964967 } else {
965968 self . chunk_by_ukey . keys ( ) . copied ( ) . collect ( )
@@ -1111,7 +1114,7 @@ impl Compilation {
11111114 mutations. extend (
11121115 revoked_modules
11131116 . iter ( )
1114- . map ( |& module| Mutation :: ModuleRevoke { module } ) ,
1117+ . map ( |& module| Mutation :: ModuleRemove { module } ) ,
11151118 ) ;
11161119 mutations. extend (
11171120 built_modules
@@ -1147,7 +1150,7 @@ impl Compilation {
11471150 . mutations_read ( IncrementalPasses :: DEPENDENCIES_DIAGNOSTICS ) ;
11481151 let modules = if let Some ( mutations) = mutations {
11491152 let revoked_modules = mutations. iter ( ) . filter_map ( |mutation| match mutation {
1150- Mutation :: ModuleRevoke { module } => Some ( * module) ,
1153+ Mutation :: ModuleRemove { module } => Some ( * module) ,
11511154 _ => None ,
11521155 } ) ;
11531156 for revoked_module in revoked_modules {
@@ -1204,6 +1207,9 @@ impl Compilation {
12041207 ) { }
12051208 logger. time_end ( start) ;
12061209
1210+ // ModuleGraph is frozen for now on, we have a module graph that won't change
1211+ // so now we can start to create a chunk graph based on the module graph
1212+
12071213 let start = logger. time ( "create chunks" ) ;
12081214 use_code_splitting_cache ( self , |compilation| async {
12091215 build_chunk_graph ( compilation) ?;
@@ -1245,6 +1251,9 @@ impl Compilation {
12451251 . await ?;
12461252 logger. time_end ( start) ;
12471253
1254+ // ChunkGraph is frozen for now on, we have a chunk graph that won't change
1255+ // so now we can start to generate assets based on the chunk graph
1256+
12481257 let start = logger. time ( "module ids" ) ;
12491258 plugin_driver. compilation_hooks . module_ids . call ( self ) ?;
12501259 logger. time_end ( start) ;
@@ -1261,7 +1270,7 @@ impl Compilation {
12611270 . mutations_read ( IncrementalPasses :: MODULES_HASHES )
12621271 {
12631272 let revoked_modules = mutations. iter ( ) . filter_map ( |mutation| match mutation {
1264- Mutation :: ModuleRevoke { module } => Some ( * module) ,
1273+ Mutation :: ModuleRemove { module } => Some ( * module) ,
12651274 _ => None ,
12661275 } ) ;
12671276 for revoked_module in revoked_modules {
@@ -1286,7 +1295,7 @@ impl Compilation {
12861295 . mutations_read ( IncrementalPasses :: MODULES_CODEGEN )
12871296 {
12881297 let revoked_modules = mutations. iter ( ) . filter_map ( |mutation| match mutation {
1289- Mutation :: ModuleRevoke { module } => Some ( * module) ,
1298+ Mutation :: ModuleRemove { module } => Some ( * module) ,
12901299 _ => None ,
12911300 } ) ;
12921301 for revoked_module in revoked_modules {
@@ -1305,7 +1314,7 @@ impl Compilation {
13051314 . mutations_read ( IncrementalPasses :: MODULES_RUNTIME_REQUIREMENTS )
13061315 {
13071316 let revoked_modules = mutations. iter ( ) . filter_map ( |mutation| match mutation {
1308- Mutation :: ModuleRevoke { module } => Some ( * module) ,
1317+ Mutation :: ModuleRemove { module } => Some ( * module) ,
13091318 _ => None ,
13101319 } ) ;
13111320 for revoked_module in revoked_modules {
@@ -1334,6 +1343,9 @@ impl Compilation {
13341343 for removed_chunk in removed_chunks {
13351344 self . cgc_runtime_requirements_results . remove ( & removed_chunk) ;
13361345 }
1346+ self
1347+ . cgc_runtime_requirements_results
1348+ . retain ( |chunk, _| self . chunk_by_ukey . contains ( chunk) ) ;
13371349 mutations. get_affected_chunks_with_chunk_graph ( self )
13381350 } else {
13391351 self . chunk_by_ukey . keys ( ) . copied ( ) . collect ( )
@@ -1364,6 +1376,9 @@ impl Compilation {
13641376 for removed_chunk in removed_chunks {
13651377 self . chunk_hashes_results . remove ( & removed_chunk) ;
13661378 }
1379+ self
1380+ . chunk_hashes_results
1381+ . retain ( |chunk, _| self . chunk_by_ukey . contains ( chunk) ) ;
13671382 mutations. get_affected_chunks_with_chunk_graph ( self )
13681383 } else {
13691384 self . chunk_by_ukey . keys ( ) . copied ( ) . collect ( )
0 commit comments