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

Feature proposal: .env.local and .env.[environment][.local] #257

Closed
mandrewcito opened this issue Jun 20, 2020 · 3 comments
Closed

Feature proposal: .env.local and .env.[environment][.local] #257

mandrewcito opened this issue Jun 20, 2020 · 3 comments

Comments

@mandrewcito
Copy link

Hi,

Is there a way to deal with local configurations or environment dependent configurations?.

I will explain my idea:

On the process of developing an app, You would have a .env file stored on the version control with a default options (a template with default values). But when you are on the development process you need a .env.local. Why? becouse you need to store your DB conection string and other config values related with your local environment. Next, on your publishing/test/stage scenario your connection strings will change so you will need a different environment file:

IMO the load secuence of the .env will be the follwing:

On development scenario:

  • .env // default options
  • .env.development // common development options
  • .env.local

On the other scenarios:

  • .env
  • .env.[staging/production]

Is there a way to configure this behaivour on the library ? if is not do you have plans to add this behaiour? I ask this because i can add this functionality to the library and make a PR if you consider it useful.

@aniketmaithani
Copy link

@mandrewcito But don't you think this would over complicate things ? I mean first of all w.r.t convention only should we keep it .env.local or .env.development similarly if we have multiple pipelines before the release such as dev , staging, qa, prod , pouring out such a thing in this library would be un-necessary. Well that's my two cents.

It would be good if we ask other contributors and devs to vote on this.
also cc: @theskumar @bbc2 your take guys ?

@bbc2
Copy link
Collaborator

bbc2 commented Jun 20, 2020

If you have default values for all environments, why not hard-code them in the application itself and override them with a different .env for each scenario?

I've seen similar feature requests in the past, regarding multiple scenarios. Please have a look at #73 for a previous discussion. Does it look like it could solve your issue?

@mandrewcito
Copy link
Author

Yes, in fact on my current apps im doing that way. Question was only for porouse a new the a feature similar to vue environment variables behaviour (https://cli.vuejs.org/guide/mode-and-env.html#modes). If you consider it an unnecesary feature to you lib its ok :D
Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants