Skip to content

Commit

Permalink
feat: only start including modules with entry point in tree shaking
Browse files Browse the repository at this point in the history
  • Loading branch information
hyf0 committed Feb 24, 2024
1 parent 9488468 commit f5b920d
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions crates/rolldown/src/bundler/stages/link_stage/tree_shaking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,6 @@ impl LinkStage<'_> {
runtime_id: self.runtime.id(),
};

for module in &self.module_table.normal_modules {
let mut stmt_infos = module.stmt_infos.iter_enumerated();
// Skip the first one, because it's the namespace variable declaration.
// We want to include it on demand.
stmt_infos.next();
stmt_infos.for_each(|(stmt_info_id, stmt_info)| {
if stmt_info.side_effect {
include_statement(context, module, stmt_info_id);
}
});
}

self.entries.iter().for_each(|entry| {
let module = &self.module_table.normal_modules[entry.id];

Expand Down

0 comments on commit f5b920d

Please sign in to comment.