Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: run dotenv-expand for each file separately #18981

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sapphi-red
Copy link
Member

Description

This PR makes the env resolution to match with docker-compose and bash, which was the reason of the breaking change of dotenv-expand v12 (motdotla/dotenv-expand#134 (comment)).

I tested the behavior of docker-compose with the following compose file.

services:
  app:
    image: busybox
    env_file:
      - .env
      - .env.production

The upside of this approach is that we will be aligned with other ecosystems.
The downside of this approach is that composing multiple env files will be difficult. For example,

# .env
VITE_APP_BASE_ROUTE=/
VITE_APP_BASE_URL=$VITE_APP_BASE_ROUTE
# .env.production
VITE_APP_BASE_ROUTE=/app/

means

VITE_APP_BASE_URL=/
VITE_APP_BASE_ROUTE=/app/

which is not likely most people expects.

fixes #18975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in .env variable expansion when loading additional files
1 participant