-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ESBuild doesn't support constant folding expressions with enums imported from external files #3425
Labels
Comments
Yes that’s correct, at least for cross-file enum inlining. |
This was referenced Jun 19, 2024
This was referenced Jun 30, 2024
This was referenced Jul 10, 2024
This was referenced Sep 17, 2024
This was referenced Sep 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Repro:
Running the command for bundling:
should result in:
but instead gives
which shows that ESBuild is not constant folding the enum in! It doesn't work either if the enum is marked as a
const enum
. For comparison, this DOES give the expected result if the enum is placed in the same file as where it's being used,main.ts
.Is this an issue where enum resolution comes after parsing/constant folding?
The text was updated successfully, but these errors were encountered: