Clarification on Vite prefix in "runtime" mode #752
Unanswered
pastinepolenta
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It seems you putting the Vite's handled environment variable keys in your This won't work because import-meta-env use You can fix this by removing |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using Vite+React and I have set env vars with the standard approach of prefixing them with
VITE_
In order to try the 12-factor approach I have addedd import-meta-env and set
transformMode: "runtime"
When I launch the build I get an error:
While I kinda get the error (and I can solve it by setting
envPrefix: 'notused',
in the vite config, I did not expect this to happen and I don't see the "requirement" documented. I thought this was taken care automatically so that we can still use the prefixVITE_
and switch config to "runtime" without further manipulation.So my question is if:
VITE_
prefix).Thanks
Beta Was this translation helpful? Give feedback.
All reactions