Unverified Commit 7fdbabca authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

feat(turbopack): Enable tree shaking for modules with dynamic imports (#71692)

### What?

We can now enable tree shaking for modules that imports `next/dynamic`.

### Why?

The bug is now fixed.

### How?

Closes PACK-3231
parent 7e9e18b1
function a(v) {
return v
}
;['index.js'].forEach(async f => {
function a(v) {
return v
}
await import(a('./dynamic-file-imports/' + f))
})
......
......@@ -490,16 +490,6 @@ impl Visit for ShouldSkip {
n.visit_children_with(self);
}
fn visit_callee(&mut self, n: &Callee) {
// TOOD(PACK-3231): Tree shaking work with dynamic imports
if matches!(n, Callee::Import(..)) {
self.skip = true;
return;
}
n.visit_children_with(self);
}
fn visit_expr(&mut self, n: &Expr) {
if self.skip {
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment