Getting Environment Variables in Production (Vite& Vuejs3) with hidden .env File (.gitignore)

248 Views Asked by At

I have built an app (vite vuejs) where I can access .env variables with the following import.meta.env

however, when I deploy the app, I can console log the environment's mode which is production but not any of the variables that I could previously get on my development mode

I am curious if having the .env file in my .gitignore makes them unreachable in production mode, and what is the solution to go about it where I can keep my variables hidden at the same time my deployed production environment updated with those variables.

0

There are 0 best solutions below