mrsteele/dotenv-webpack

starting my application failed if .env is not exist.

Opened this issue · 1 comments

This is weird behaviour, espically because i have .env.defaults.
starting my application failed if .env is not exist.

Why it is strictly needed, if i do not want to include .env in addition for my .env.defaults?
Hope someone can help me understand it better, thank you.

Think its because the default is set and then it uses that as a prefix to find .defaults / would have to see what is going on and experiment with it. Could try to see if allowEmptyVar could be a work around. That would require safe as well, but use case is still interesting.

Learning and playing rn and I was setting up my project in this exact manner. To get it to work I had to change the path to the environment that I wanted and then enable defaults more so to be a common amongst my different environments. Which is what I assume the intended functionality was supposed to be.

Wasn't very straight forward and don't actually know if that's what it was meant for because originally I just wanted to use safe to load the specific environment I wanted and populate what wasn't declared and assumed since I had defaults it would merge that first then use my specific environment.

Anyway. Assuming that this would need a ".env" file to start with and then it can work and it won't create one just utilize what is given. I only very briefly scrolled through code so most of this is black box analysis. Salt to taste.