-
-
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
Expose use_define_for_class_fields
in SWC config
#3317
Comments
Hmmm, interesting, but both Babel and SWC preserve class fields when targeting the latest version of ES. SWC only tweaks the class fields when using the TypeScript syntax, so I'm not sure this assumption is playing a role here. |
No, typescript has its seperate class field transform pass |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the feature
When compiling a class with class fields using TypeScript syntax, SWC currently down-levels class fields no matter what version of JS is being targeted.
In other words, this:
gets turned into this:
no matter what config options you use.
However, the capability to avoid this down-leveling already exists in SWC (and is even tested!) but is unfortunately simply not exposed as a config option in the the SWC config itself.
Could you please provide a way to actually enable this feature in the SWC config?
Babel plugin or link to the feature description
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: