AnC
AnC

Reputation: 4201

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.

Upvotes: 9

Views: 6655

Answers (2)

irrelephant
irrelephant

Reputation: 376

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.

Upvotes: 4

ChristianM
ChristianM

Reputation: 1823

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

Upvotes: 3

Related Questions