vite-react-jsx icon indicating copy to clipboard operation
vite-react-jsx copied to clipboard

it it production ready? Does anyone has the experience with this?

Open vikbert opened this issue 4 years ago • 5 comments

vikbert avatar Jun 10 '21 14:06 vikbert

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 avatar Jun 22 '21 13:06 FelixIncerta

@FelixIncerta fork this repo and reproduce the issue in the demo folder if you can, and I'll take a look

aleclarson avatar Jun 22 '21 14:06 aleclarson

This is the exact error when i do tsc && vite build Only for components where React is not imported

image

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(),
  ]
});

FelixIncerta avatar Jun 25 '21 14:06 FelixIncerta

@aleclarson Thank you here is my fork https://github.com/FelixIncerta/vite-react-jsx I have this error on vite build image

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

FelixIncerta avatar Jun 28 '21 14:06 FelixIncerta

after adding this 'react/jsx-runtime': dirNodeModules+ '/react/cjs/react-jsx-runtime.production.min.js', in resolve.alias it seems to be working..

FelixIncerta avatar Jun 29 '21 09:06 FelixIncerta