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: allow expandable env vars to reference any non-expandable env vars #18982

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

Conversation

sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Dec 17, 2024

Description

This PR makes Vite to allow expandable env vars (the env vars that will be expanded by dotenv-expand) to reference any non-expandable env vars.

The downside and upside is the opposite of #18981.

Even with this PR,

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

still means

VITE_APP_BASE_URL=/app/
VITE_APP_BASE_ROUTE=/app/

fixes #18975
alternative to #18981

@sapphi-red
Copy link
Member Author

I'm leaning towards this approach because it's easier to compose multiple env files, even if it means that our env files will work differently than others.

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