Hello there…. Is there a way to configure the `.e...
# sst
a
Hello there…. Is there a way to configure the
.env
files to have some level of hierarchy? Like
.env
should be applied always, then on top of it apply
.<http://env.dev|env.dev>
if the STAGE=dev …. and so on… I need to do this due I have some env-vars which are repeated across environments/stages.
a
That is what it does, as far as you stated. (I don't know what "and so on" would be.)
a
Yeah sorry.
I want to apply
.<http://env.dev|env.dev>
and later
.env
.. I think that’s what it does by default?
a
No, other way. The more specific config for the stage overrides anything the base .env config. There's an option for .local as well.
s
I've been thinking about this hierarchy lately (I use them myself). Should I think of
.env
as my production configuration that gets overridden with more specific environments? Or should I have a .env.prod to be more specific?
I think I understand what I can do with this tool, I'm just not sure what I should do 🙂
a
Common and defaults in
.dev
. Environment specific overrides in
.env.<stage>
.
r
I always feel like, if you have an env file for prod it certainly doesn't hurt to have prod in the name
s
yeah, I'd prefer prod to be explicit