I frequently use .env files to keep API keys and other "secret stuff" from getting checked into my repo. I made a couple of minor modifications to your setup to make this work for me:
Add src/environments/environment.* to ./.gitignore
Added a file src/environments/sample.environment.ts that contains a basic template and instructions for what to put in environment[.dev].ts
Now I can put secret stuff in my ENV and not worry that it will show up in my repo. Secret keys will get compiled into native apps and be mostly secure. Some other solution would have to be used for PWA's.
When I use environment variables for my projects, I do ignore my files as you suggested. I will update my README to make sure to tell people to ignore their files!
Thanks for this!
I frequently use
.env
files to keep API keys and other "secret stuff" from getting checked into my repo. I made a couple of minor modifications to your setup to make this work for me:src/environments/environment.*
to./.gitignore
src/environments/sample.environment.ts
that contains a basic template and instructions for what to put inenvironment[.dev].ts
Now I can put secret stuff in my
ENV
and not worry that it will show up in my repo. Secret keys will get compiled into native apps and be mostly secure. Some other solution would have to be used for PWA's.