Skip to content

Commit 3a7184d

Browse files
committed
Fix treeshaking for imports
1 parent 1436903 commit 3a7184d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/start/src/directives/remove-unused-variables.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export function removeUnusedVariables(program: babel.NodePath<t.Program>) {
2424
case "hoisted":
2525
case "module":
2626
if (binding.references === 0 && !binding.path.removed) {
27-
if (isPathValid(path.parentPath, t.isImportDeclaration)) {
28-
const parent = path.parentPath;
27+
if (isPathValid(binding.path.parentPath, t.isImportDeclaration)) {
28+
const parent = binding.path.parentPath;
2929
if (parent.node.specifiers.length === 1) {
3030
parent.remove();
3131
} else {

0 commit comments

Comments
 (0)