write a plugin to force class in es5 #130
Unanswered
farfromrefug
asked this question in
Q&A
Replies: 1 comment
-
Basic idea is borrowing swc/core's exsting transform and let it run via plugins regardless of swc config target setting. This is essentially swc-project/swc#4826, while there maybe some core transform won't work in plugin context which may need to be fixed. There isn't a straightforward code examples afailk. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Nativescript we currently use a tsc transformer to detect classes with a special
@NativeClass
decorator and enforce that that class be in es5 syntax with__extends
. In the process the@NativeClass
decorator is removed.We would like to support swc so for that we need that transformer ported to swc. At first i was thinking we should wait for tsc transformer to be supported but i know i am thinking it might be better to write a custom plugin for our purpose to do this.
Do you think that would be feasible? Is there any code exemple / reference i could get to get started on this? I see 3 parts to this:
Beta Was this translation helpful? Give feedback.
All reactions