Replies: 3 comments
-
Hi, at my work, we need to deploy the same codebase to different hosts, and the environment variables are different between those deployments, like Like you said, the bundler always inlines environment variables into the output, which forces us to build the entire application multiple times during release for different deployments. I recently wrote a plugin for people who want to load environment variables after bundling their application. I also wrote a post about this in medium. Hope it helps you. |
Beta Was this translation helpful? Give feedback.
-
This issue is common with both Create React App and Vite. Why not address this problem by including a solution in our process? We aim to create a Docker image and then start containers with varying environment variables for different stages such as testing, staging, and production. Our goal is to avoid building a new image every time the value of an environment variable changes. |
Beta Was this translation helpful? Give feedback.
-
Hi,
at work I need to make it possible to change the environmet variables at runtime, from an Azure web service, through docker and nginx.
I tried this, this and some similar solutions, but I couln't get any of them to work.
I also couldn't find any solution online or any article/thread/post that explained if this is even possible, I only always find the text that vite statically replaces the env variables at build time.
During our CI/CD pipeline vite gets the env variables but our Azure admins want to be able to configure them from Azure, just for the case of it.
Does anyone know if this is possible and or maybe has a solution or som help, please ? :)
Beta Was this translation helpful? Give feedback.
All reactions