I want to use some npm packages in a symfony app where I use different environments (local dev, staging, live, ...). It seems that your package only reads the .env file, but not .env.local and other .env files for different environments.
The .env-File is like a template to configurate. I copy it in the environment. .env is managed via git, but not the other .env-Files like .env.local
I came here to ask exactly this. The readme says what not to do, but offers no clear guidance (that I saw) on what ought to be done instead.
Perhaps this section can be expanded...?
https://github.com/motdotla/dotenv#should-i-have-multiple-env-files
This is possibly a duplicate of https://github.com/motdotla/dotenv/issues/437
It's a very common and practical approach to use .env, .env.local, etc. Here are the examples:
This statement — https://github.com/motdotla/dotenv#should-i-have-multiple-env-files — is really confusing and looks more like a dogma.
I recently learned about https://www.npmjs.com/package/dotenv-flow, which might address some people's needs.
I would recommend using dotenv flow! Its a great package and uses this package at its core. Sorry for the dogmatic phrasing in the README, the opinions in the readme have not been updated for a while. There have been lots of discussions about that one part of the readme. Closing this issue for now.
Most helpful comment
I recently learned about https://www.npmjs.com/package/dotenv-flow, which might address some people's needs.