Is there a stand-alone transpiler for converting JSX to JavaScript (i.e. just <foo … />
→ createElement("foo", …)
, nothing else)?
I know I could just use Babel with the transform-react-jsx plugin, but would not want to prescribe an ES6 transpiler.
I think your best bet is going to be using Babel, since the other standalone packages are not being updated/maintained.
I'm not sure why you have an aversion to using Babel, but you can pick the transformations that are applied, you can use it programmatically, and you can even use a standalone version that works in the browser, so I think it should suit your needs.
This may be interested: https://github.com/RReverser/acorn-jsx
Finally two older projects that could still be useful for you: https://github.com/facebookarchive/jstransform
https://github.com/alexmingoia/jsx-transform
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With