Closed
Description
What is the problem this feature will solve?
#50588 introduced a throw if a requested env file isn't found. When dealing with multiple environments, a .env file may sometimes be merely optional - and throwing isn't desired. For example, during local development, devs might keep variables in a .env
file, which isn't committed to source control, while in production, these variables come from the environment. This option will allow the env file to be loaded only if it exists without changing the command used to invoke node between environments.
What is the feature you are proposing to solve the problem?
Add a flag (or other mechanism) to indicate that the .env file should be loaded only it's found, and to throw otherwise.
What alternatives have you considered?
touch
ing .env
before running node; invoking node via a shell script and "building up" the cli opts.