motion icon indicating copy to clipboard operation
motion copied to clipboard

Resolving JSX

Open tomitrescak opened this issue 7 years ago • 3 comments

Hi. I really like the project, and pundler is simply amazing!

I have a bit of issue though, I'm using typescript which transpiles React files to JSX not JS. How can I make the app recognise JSX extension?

Thanks

tomitrescak avatar Aug 27 '16 03:08 tomitrescak

Are you importing it locally or from a module? Does typescript not support compiling to *js?

natew avatar Aug 27 '16 09:08 natew

@tomitrescak You don't really have to use the jsx extension as @natew hinted. You can just use the normal .js extension and rest assured it'll not break anything or lead to any unexpected behaviors.

We could of course add support for configuring pundle's supported require extensions but don't really have a solid use case for it (yet?)

steelbrain avatar Aug 27 '16 09:08 steelbrain

Guys, unfortunately typescript outputs TSX only to JSX, there is no way to change that. The only possibility is to output TSX code to react (React.createClass) that is much harder to debug.

So, the workflow is to output TSX code to pure ES6 with original markup for easier debug. Having JSX wil make a lot of Angular people happy as well as other TS enthusiasts.

tomitrescak avatar Sep 03 '16 00:09 tomitrescak