vite-react-jsx
vite-react-jsx copied to clipboard
it it production ready? Does anyone has the experience with this?
This does not work for me in production. Having this issue but i think it is related to this plugin https://github.com/vitejs/vite/issues/3876
in dev it works for production not due to that jsx-runtime error in devtools console..
@FelixIncerta fork this repo and reproduce the issue in the demo folder if you can, and I'll take a look
This is the exact error when i do tsc && vite build
Only for components where React is not imported

import reactRefresh from '@vitejs/plugin-react-refresh';
import { defineConfig } from 'vite';
import reactJsx from 'vite-react-jsx'
// https://vitejs.dev/config/
export default defineConfig({
server: {
https: true,
},
plugins: [
reactJsx(),
reactRefresh(),
]
});
@aleclarson Thank you
here is my fork
https://github.com/FelixIncerta/vite-react-jsx
I have this error on vite build

the error suggests adding react/jsx-runtime to build.rollupOptions.external but then i get the other error mentioned above and in vitejs/vite#3876
after adding this
'react/jsx-runtime': dirNodeModules+ '/react/cjs/react-jsx-runtime.production.min.js',
in resolve.alias it seems to be working..