Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

doesn't parse .env.local #56

Open
ralyodio opened this issue Oct 28, 2021 · 11 comments
Open

doesn't parse .env.local #56

ralyodio opened this issue Oct 28, 2021 · 11 comments

Comments

@ralyodio
Copy link

import "https://deno.land/x/dotenv/load.ts"

this doesn't parse .env.local

@pasha-bolokhov
Copy link
Contributor

Is that really an issue? I mean, people can have many different names for their env files: .env.test, .env.ci and .env.local and various different combinations — it is not really possible to predict them, and perhaps not worth trying
(I even think that this feature of automatic loading of the environment is unnecessary, as it disables you from doing the import in a controlled and configured way — but that perhaps is a different question)

@winston0410
Copy link

@pasha-bolokhov I think that is a new convention building up in Node.js community, promoted by Vite. It would be great it this can be provided.

Idea: https://vitejs.dev/guide/env-and-mode.html#env-files

I think the original dotenv has implemented this as well

@pasha-bolokhov
Copy link
Contributor

Would be interesting to see how Node implemented it. I mean it's all straightforward except where do you get the current mode from?

@winston0410
Copy link

Usually they get that from NODE_ENV. Is this env used at all in Deno? I don't think it is necessary in Deno's context?

@pasha-bolokhov
Copy link
Contributor

I've never seen it being used. But it's not that we can't use it. We can use NODE_ENV just for the sake of getting the current running mode. Can also (in addition) use DENO_ENV with a higher priority. How does that sound?

@winston0410
Copy link

I've never seen it being used. But it's not that we can't use it. We can use NODE_ENV just for the sake of getting the current running mode. Can also (in addition) use DENO_ENV with a higher priority. How does that sound?

That sounds good to me!

@pasha-bolokhov
Copy link
Contributor

Just to mention, I did not notice it having been implemented in Node. If anyone has, lemme know, it would be good to follow the same pattern. If they haven't, then we have a chance to be faster than them…

@winston0410
Copy link

I think that is implemented in dotenv of NPM already? But I am not sure where in their source.

@pasha-bolokhov
Copy link
Contributor

It never mentions it in the docs, never found it

@pasha-bolokhov
Copy link
Contributor

This is what they have on their docs page:
https://github.com/motdotla/dotenv#should-i-have-multiple-env-files

@pasha-bolokhov
Copy link
Contributor

So we need to make some consensus on whether or not or how to proceed…

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

No branches or pull requests

3 participants