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

Missing support for jsx option #261

Closed
maxmilton opened this issue May 25, 2021 · 5 comments
Closed

Missing support for jsx option #261

maxmilton opened this issue May 25, 2021 · 5 comments
Labels

Comments

@maxmilton
Copy link

Recently esbuild v0.12.1 introduced the jsx=preserve option: https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#0121.

Would be great if rollup-plugin-esbuild would add support for passing the option through.

@egoist
Copy link
Owner

egoist commented May 27, 2021

What's your use case? do you want to use other rollup plugins to handle JSX?

@maxmilton
Copy link
Author

Yes, pretty much.

In projects which use the https://github.com/solidjs/solid framework, they require a babel preset to convert JSX into solid specific runtime calls. Solid leverages the JSX ecosystem rather than implementing their own component DSL.

For TypeScript support in these projects it's currently required to use @babel/preset-typescript along with tsconfig.json like:

{
  "compilerOptions": {
    "jsx": "preserve",
    "jsxImportSource": "solid-js"
  }
}

With the jsx=preserve option in rollup-plugin-esbuild, I was hoping I could rip out @babel/preset-typescript and instead transpile TS via rollup-plugin-esbuild first for faster build times. That way I could run babel only on files which might be solid components (*.tsx).

@egoist
Copy link
Owner

egoist commented May 29, 2021 via email

@egoist egoist closed this as completed in 1404fbb Jun 2, 2021
@github-actions
Copy link

github-actions bot commented Jun 2, 2021

🎉 This issue has been resolved in version 4.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@maxmilton
Copy link
Author

Following up on this, the jsx: preserve option works great, thank you for introducing the change 👍

I was able to set up my build to run .tsx through rollup-plugin-esbuild first and then babel with only babel-preset-solid.

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

No branches or pull requests

2 participants