Repository navigation
Vite react plugin not transforming process.env in library mode #261
|
I have an issue with vite and react. When I'm building against index.html everything works fine, but if I configure vite to build a JavaScript module then references to process.env.NODE_ENV get left in my code, causing exceptions at runtime. I know that the correct way is for the code to reference import.meta.env instead of process.env, and my working theory is that the vite-react-plugin normally takes care of this, but apparently not when building a library. (Is "library mode" the right thing to call it?) Have you ever had this issue and how did you solve it? |
Answered by
ArnaudBarre
Nov 26, 2023
Replies: 1 comment
|
This is an expected behavior: vitejs/vite#8090 |
0 replies
Answer selected by
MaxWilson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an expected behavior: vitejs/vite#8090
See this comment if you want to continue using this kind of outdating pattern: vitejs/vite#8090 (comment)