How to access environment variables in config.mts? #3333
-
Hi! Let's say I have this .env.development file and I want to access these envs:
And I want to do something like this:
Also how do I use them on build? Normally with Vite, we do |
Beta Was this translation helpful? Give feedback.
Answered by
onurusluca
Dec 14, 2023
Replies: 1 comment 2 replies
-
After a lot of research, I got it working. I don't know if this is the best way, but hey it works:
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
onurusluca
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After a lot of research, I got it working. I don't know if this is the best way, but hey it works:
cross-env
:pnpm add cross-env
config.mts
, now we can use process.env.ENVIRONMENT