Skip to content

const enums are not stripped when referred in another const enum #4157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nekogirls1337 opened this issue Apr 23, 2025 · 0 comments
Open

Comments

@nekogirls1337
Copy link

const enum First {
    A = 1,
    B = 2,
    C = 3
}

const enum Second {
    D = First.A * 2,
    E = First.B * 3,
    F = First.C * 4
}

console.log(Second.E + Second.F)

> bun build --minify test.ts
> console.log(18);

> bunx esbuild --minify test.ts
> "use strict";var First=(l=>(l[l.A=1]="A",l[l.B=2]="B",l[l.C=3]="C",l))(First||{}),Second=(l=>(l[l.D=2]="D",l[l.E=6]="E",l[l.F=12]="F",l))(Second||{});console.log(18);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant