-
-
Notifications
You must be signed in to change notification settings - Fork 121
Bring back const enums #533
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
Comments
Even with preserveConstEnums enabled, ts doesn't allow reverse mapping for const enums. |
As such, we will not bring them back. I'd be more worried why parcel or whatever bundler you use doesn't treeshake properly (is this our fault? Is it something else?) Feel free to open an issue (or even a pull request) if treeshaking fails, and a repository to test it with, and we'll take a look :D |
That's fair. Thank you for the detailed response. |
History: #295
So there was a transpilation bug (microsoft/TypeScript#40499) that some people ran into, but that was fixed in Typescript 4.2. It should be possible to set
preserveConstEnums
and get the best of both worlds. I wouldn't be so bothered except my bundle size (via parcel) goes from 3k to 27k because it pulls in the whole big chunk for just a few numbers.The text was updated successfully, but these errors were encountered: