Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts_library compiles tsx files to js not jsx #1730

Closed
calebmer opened this issue Mar 25, 2020 · 2 comments · Fixed by #1732
Closed

ts_library compiles tsx files to js not jsx #1730

calebmer opened this issue Mar 25, 2020 · 2 comments · Fixed by #1732
Labels

Comments

@calebmer
Copy link

On first glance this appears to be incorrect because ts_library compiles .tsx files to .js and not .jsx. Am I missing something or could we change this?

https://github.com/bazelbuild/rules_nodejs/blob/04204df8848faf9024d8200bff32e8f0db82003c/internal/node/node.bzl#L120-L121

@alexeagle
Copy link
Collaborator

you're right, not just ts_library but also tsc produces .js for .tsx inputs, so this is the entry point we should be looking for.

I'm surprised you wrote a node program with a .tsx extension though... is that the entry point for server-side rendering or something?

@calebmer
Copy link
Author

at Airtable we use the convention that all TypeScript files have the .tsx extension

we think of it as TypeScript syntax v2 so instead of supporting three dialects (JS, TS, TSX) we choose to only support two

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants