Skip to content

Commit

Permalink
Fix: fully remove TS nested type-only exported namespaces (#15882)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangguansen authored Aug 24, 2023
1 parent c3f03f6 commit 48d12ef
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/babel-plugin-transform-typescript/src/namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ function handleNested(
transformed,
);
}
} else {
namespaceTopLevel.splice(i, 1);
i--;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export namespace A {
export namespace B {
export interface C {
D?: number;
E?: number;
F?: string;
}
}

export enum G {
H = 0
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export let A;
(function (_A) {
let G = /*#__PURE__*/function (G) {
G[G["H"] = 0] = "H";
return G;
}({});
_A.G = G;
})(A || (A = {}));

0 comments on commit 48d12ef

Please sign in to comment.