-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jsx preserve does not work #18168
Comments
Preserving jsx for build is likely not supported. For one, it looks like rollup requires a parser plugin to do that rollup/rollup#4431 but with some caveat. Even if that works on rollup, Vite's transform pipeline expects plain js (for example, |
Any confirmation that this is not supported and maybe some hints on how to get around this? In theory I could produce the |
I tried to follow rollup/rollup#4431 but it turned out
(On Vite side, you could set |
OK I see, thank you. At least setting |
Describe the bug
I am trying to build a library containing
tsx
files to ouputjsx
files. As I understand this is done by setting thejsx
config intsconfig.json
topreserve
. For some reason I cannot make this work and it will always output ajs
file usingReact.createElement
.Reproduction
https://github.com/DavidVollmers/vite-jsx-lib
Steps to reproduce
Run
npm i
and thennx build
and look into thedist
folder. It will contain only alib/index.js
files and nolib/index.jsx
file. Also in thelib/index.js
file you will see the following output generated:System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: