Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

transpiling JSX without Babel

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.

like image 824
AnC Avatar asked Feb 04 '17 09:02

AnC


2 Answers

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.

like image 65
irrelephant Avatar answered Oct 27 '22 01:10

irrelephant


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

like image 42
ChristianM Avatar answered Oct 26 '22 23:10

ChristianM