-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the problem
Static environment variables must be present at build-time. See #6165
This means that every time I add a feature I want to be controlled by an environment variable, I need to add a value (even if it is a blank value) to my deployment tool (Cloudflare Pages), my CI tool (GitHub Actions), my own local environment (.env) and also notify all other developers on the project that they should update their .env files with this blank value. If this value were a necessary thing, like an API key required for the app to work, that would be expected. But when it's for a feature flag or some metrics or error-reporting thing that is only needed in production, it feels like a lot of unnecessary work.
Describe the proposed solution
I would love a way to supply default values for env vars.
Alternatives considered
I considered making a .env.example file and a script that compares .env.example and .env and populates .env with any missing values on yarn dev or yarn build
Importance
nice to have
Additional Information
No response