Skip to content

Commit

Permalink
preserve side effect
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Oct 21, 2024
1 parent 65fddfe commit f91fea2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,19 @@ impl DepGraph {
}

// Do not store export * in internal part fragments.
if let ModuleItem::ModuleDecl(ModuleDecl::ExportAll(..)) = &data[g].content {
if let ModuleItem::ModuleDecl(ModuleDecl::ExportAll(export)) = &data[g].content {
// Preserve side effects of import caused by export *
chunk
.body
.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
span: export.span,
specifiers: Default::default(),
src: export.src.clone(),
type_only: false,
with: export.with.clone(),
phase: Default::default(),
})));

continue;
}

Expand Down

0 comments on commit f91fea2

Please sign in to comment.