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

Allow .env files to be ignored by netlify dev command #3393

Closed
aaronransley opened this issue Sep 23, 2021 · 3 comments
Closed

Allow .env files to be ignored by netlify dev command #3393

aaronransley opened this issue Sep 23, 2021 · 3 comments
Labels
area: command: dev area: dx type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@aaronransley
Copy link

aaronransley commented Sep 23, 2021

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

@aaronransley aaronransley added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Sep 23, 2021
@erezrokah
Copy link
Contributor

Thanks @aaronransley, this is somehow related to #1303.

However, I think you should be able to use .env.development for local overrides per

const dotenvFiles = ['.env', '.env.development']
until we decide on the flow we want to support.

@Soviut
Copy link

Soviut commented Apr 26, 2022

@erezrokah Related? #4321

@sarahetter
Copy link
Contributor

Closing as stale. Please re-open if needed

@sarahetter sarahetter closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: command: dev area: dx type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

4 participants