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

Feature request: add support for jsxImportSource #715

Closed
stevenle opened this issue Sep 12, 2022 · 5 comments
Closed

Feature request: add support for jsxImportSource #715

stevenle opened this issue Sep 12, 2022 · 5 comments

Comments

@stevenle
Copy link

stevenle commented Sep 12, 2022

https://esbuild.github.io/api/#jsx-import-source
^ relevant esbuild docs

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@gavinsharp
Copy link
Contributor

gavinsharp commented Oct 15, 2022

As of v6.2.2, tsup is using a version of esbuild that supports the new JSX transform, so you should be able to specify jsxImportSource (along with "jsx": "react-jsx") in tsconfig.json and have tsup/esbuild pick it up automatically.

@stevenle
Copy link
Author

@gavinsharp thanks for the heads up, just upgraded and tested, working as expected!

@shellscape
Copy link

@gavinsharp as of 8.0.0, jsxImportSource doesn't exist on the Options type. And tsup doesn't even pass jsxImportSource to esbuild if you pass it with as any. Simply doesn't work.

@gavinsharp
Copy link
Contributor

@gavinsharp as of 8.0.0, jsxImportSource doesn't exist on the Options type. And tsup doesn't even pass jsxImportSource to esbuild if you pass it with as any. Simply doesn't work.

I was suggesting esbuild would read jsxImportSource directly from the tsconfig on its own, independently of tsup. It's possible something has changed since, but that was working for me when I made the comment.

@shellscape
Copy link

Ah distinct difference there. I've a patch that I'm going to open a PR for that adds support to the Options so tsconfig doesn't have to be relied upon.

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

No branches or pull requests

3 participants