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

Expand environment variables when using useDotenv: true in serverless configuration #9689

Closed
d-asensio opened this issue Jul 4, 2021 · 0 comments · Fixed by #9615
Closed

Comments

@d-asensio
Copy link
Contributor

d-asensio commented Jul 4, 2021

Use case description

Currently, when enabling the useDotenv flag, the .env file that matches the specified stage (.evn.local, .env.production, etc...) using dotenv directly. However dotenv do not expand environment variables, so users of serverless can't combine them in their .env files.

As a serverless user, I would find it very useful to be able to combine environment variables in such way:

API_BASE_URL=my.api.com
API_PROTOCOL=https

API_URL=$API_PROTOCOL/$API_BASE_URL

Proposed solution

As it is solved in other packages (as dotenv-cli) and as it is recommended by the README of dotenv I would suggest using dotenv-expand for this purpose.

I have created a PR with the proposed changes above.

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

Successfully merging a pull request may close this issue.

2 participants