Skip to content

Commit

Permalink
Preserve module evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Sep 4, 2024
1 parent 8f04d75 commit 6f5c13e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,15 @@ impl DepGraph {
}

for g in group {
// Skip directives
// Skip directives, as we copy them to each modules.
if let ModuleItem::Stmt(Stmt::Expr(ExprStmt {
expr: box Expr::Lit(Lit::Str(_)),
expr: box Expr::Lit(Lit::Str(s)),
..
})) = &data[g].content
{
continue;
if s.value.starts_with("use ") {
continue;
}
}
chunk.body.push(data[g].content.clone());
}
Expand Down

0 comments on commit 6f5c13e

Please sign in to comment.