You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you may depend on environment variables in some way and may want to provide a default value in case one is not set. For instance, we have an API gateway that we need to configure locally and it's based on the current URL. In .env we set it up as follows:
REACT_APP_API_GATEWAY_BASE_URL=localhost:${PORT}
This works as long as PORT is set. create-react-app defaults to port 3000 in case it's not set. Ideally, we'd like to express that in our .env file using default expansion:
Unfortunately, this doesn't work as the current version of dotenv-expand does not support it. Default expansion was introduced in 6.0.0.
Describe the solution you'd like
Consider bumping dotenv-expand (and by extension, dotenv) to at least version 6.0.1 to add support for default expansion (e.g., ${VAR:-DEFAULT}. This is helpful when you want to provide a default value in case an environment variable isn't set.
Describe alternatives you've considered
None.
Additional context
None.
The text was updated successfully, but these errors were encountered:
Is your proposal related to a problem?
Sometimes you may depend on environment variables in some way and may want to provide a default value in case one is not set. For instance, we have an API gateway that we need to configure locally and it's based on the current URL. In
.env
we set it up as follows:This works as long as
PORT
is set.create-react-app
defaults to port3000
in case it's not set. Ideally, we'd like to express that in our.env
file using default expansion:Unfortunately, this doesn't work as the current version of dotenv-expand does not support it. Default expansion was introduced in
6.0.0
.Describe the solution you'd like
Consider bumping dotenv-expand (and by extension, dotenv) to at least version
6.0.1
to add support for default expansion (e.g.,${VAR:-DEFAULT}
. This is helpful when you want to provide a default value in case an environment variable isn't set.Describe alternatives you've considered
None.
Additional context
None.
The text was updated successfully, but these errors were encountered: