Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

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

Open
vikbert opened this issue Jun 10, 2021 · 5 comments
Open

Comments

@vikbert
Copy link

vikbert commented Jun 10, 2021

No description provided.

@FelixIncerta
Copy link

This does not work for me in production.
Having this issue but i think it is related to this plugin
vitejs/vite#3876

in dev it works
for production not due to that jsx-runtime error in devtools console..

@aleclarson
Copy link
Contributor

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

@FelixIncerta
Copy link

FelixIncerta commented Jun 25, 2021

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
Copy link

@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
Copy link

FelixIncerta commented Jun 29, 2021

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

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

No branches or pull requests

3 participants