cli
cli copied to clipboard
Allow `.env` files to be ignored by `netlify dev` command
Is your feature request related to a problem? Please describe.
There is no way to opt-out of the reading of environment variables from .env
files in the root of my project directory when running netlify dev
.
Describe the solution you'd like
I'd like the ability to use netlify dev
without .env
files in my project directory being read / considered.
Describe alternatives you've considered
Alternatives at the moment are to avoid using .env
files as I have them setup across my project, perhaps renaming them and reconfiguring dotenv-flow
to consider the new file names. However, I think this is more complex than netlify dev
offering a --ignore-local-env
flag or similar.
Additional context
I am using the dotenv-flow
methodology of managing .env
files, so my .env
file doesn't contain local overrides; it instead contains sensible defaults and local overrides exist in .env.local
.
Can you submit a pull request?
Yes
Thanks @aaronransley, this is somehow related to https://github.com/netlify/cli/issues/1303.
However, I think you should be able to use .env.development
for local overrides per https://github.com/netlify/cli/blob/4fa5d077789b77984457d6b7adb51a6bc3da099b/src/utils/dot-env.js#L21 until we decide on the flow we want to support.
@erezrokah Related? https://github.com/netlify/cli/pull/4321
Closing as stale. Please re-open if needed