-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Automatic env file resolution is in reverse order of precedence #131
Comments
When I implemented this, I used the create-react-app code as a sample. I now see this reduce may be causing issues. https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/config/env.js |
Is that why |
|
I use this plugin in my local environment and when I deploy to the environments, however |
@feeh27 You should not commit If you are running the deployment locally, I suggest you use |
I understood, really the way the library works and the projects I work on understand the I have already managed to adjust this in my pipelines deleting the Thank you for your attention. |
I'm still seeing .env values override .env..local. In my case .env.test.local. |
The README says
But the code says
serverless-dotenv-plugin/index.js
Lines 64 to 72 in 6fc076c
serverless-dotenv-plugin/index.js
Lines 84 to 91 in 6fc076c
That last
.reduce()
call means we're actually resolving the files in reverse order of precedence, since env vars in lower priority files are overwriting the ones in higher priority files.The fix is potentially a breaking change, and so requires a major version bump.
The text was updated successfully, but these errors were encountered: