-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
jsxInject: Maybe not a good idea yet #4
Comments
I think a common way for all bundlers to do this would be to use the esbuild option. In dev case add preact.shim and devtools.shim. In prod case only preact.shim. The shim file could be provided from the preact module self. |
I just came across this problem today. I'm pretty new to Vite, but fairly familiar with Preact. I am trying to add tests via Mocha, but with Is there some other way of going about solving the issue from the testing side? With my limited knowledge, I haven't found a solution. The only way I've been able to get both Vite and Mocha happy is to add a plugin that returns this block for the config
For some reason just including that in the outer Vite config didn't work... I had to make it a plugin. This allowed me to get things working by manually adding |
Looks like the option will be deprecated shortly anyways, see vitejs/vite#2369 (comment) |
With #18 being accepted you should be able to define/ overwrite the |
The jsxInject is only implemented in vite, not in esbuild or anywhere.
The app code is not runnable in general without JSX imports, with @webpack or @snowpackjs.
preset-vite/src/index.ts
Line 17 in b329a20
Maybe it is possible to comment out this option until it is supported by @evanw (esbuild) / @babel etc. itself.
The text was updated successfully, but these errors were encountered: