@@ -18,7 +18,7 @@ type ChunkMetaImports = IndexVec<ChunkId, FxHashSet<SymbolRef>>;
1818type ChunkMetaImportsForExternalModules =
1919 IndexVec < ChunkId , FxHashMap < ExternalModuleId , Vec < NamedImport > > > ;
2020type ChunkMetaExports = IndexVec < ChunkId , FxHashSet < SymbolRef > > ;
21- type IndexCrossChunkImports = IndexVec < ChunkId , Vec < ChunkId > > ;
21+ type IndexCrossChunkImports = IndexVec < ChunkId , FxHashSet < ChunkId > > ;
2222type IndexCrossChunkDynamicImports =
2323 IndexVec < ChunkId , IndexSet < ChunkId , BuildHasherDefault < FxHasher > > > ;
2424
@@ -150,7 +150,7 @@ impl<'a> GenerateStage<'a> {
150150 FxHashMap < ChunkId , Vec < CrossChunkImportItem > > ,
151151 > = index_vec ! [ FxHashMap :: <ChunkId , Vec <CrossChunkImportItem >>:: default ( ) ; chunk_graph. chunks. len( ) ] ;
152152 let mut index_cross_chunk_imports: IndexCrossChunkImports =
153- index_vec ! [ vec! [ ] ; chunk_graph. chunks. len( ) ] ;
153+ index_vec ! [ FxHashSet :: default ( ) ; chunk_graph. chunks. len( ) ] ;
154154 let mut index_cross_chunk_dynamic_imports: IndexCrossChunkDynamicImports =
155155 index_vec ! [ IndexSet :: default ( ) ; chunk_graph. chunks. len( ) ] ;
156156
@@ -177,7 +177,7 @@ impl<'a> GenerateStage<'a> {
177177 } ) ;
178178 // Check if the import is from another chunk
179179 if chunk_id != importee_chunk_id {
180- index_cross_chunk_imports[ chunk_id] . push ( importee_chunk_id) ;
180+ index_cross_chunk_imports[ chunk_id] . insert ( importee_chunk_id) ;
181181 let imports_from_other_chunks = & mut imports_from_other_chunks_vec[ chunk_id] ;
182182 imports_from_other_chunks
183183 . entry ( importee_chunk_id)
0 commit comments