Skip to content

Commit 0cc8976

Browse files
committed
perf: improve get mode
1 parent e6e2ef0 commit 0cc8976

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,8 +1459,14 @@ fn determine_export_assignments(
14591459
let mut dependency_indices =
14601460
Vec::with_capacity(dependencies.len() + usize::from(additional_dependency.is_some()));
14611461

1462+
let mut handled_modules = IdentifierSet::default();
1463+
14621464
for dependency in dependencies.iter().chain(additional_dependency.iter()) {
14631465
if let Some(module_identifier) = module_graph.module_identifier_by_dependency_id(dependency) {
1466+
if !handled_modules.insert(*module_identifier) {
1467+
dependency_indices.push(names.len());
1468+
continue;
1469+
}
14641470
let exports_info = module_graph
14651471
.get_exports_info(module_identifier)
14661472
.as_data(module_graph);

0 commit comments

Comments
 (0)