I used to have a
src/config/config.ts.sample in my repo and in
.gitignore a line with
src/config/config.ts, so after cloning a project a developer just needed to copy
config.ts and that’s it, you could have env / prod vars depending on your needs (when building, we just replaced that file with prod values). In Pro (I’ve signed for the paid plan this week), since you have a new repo tu push and it builds from there (unlike before, where
ionic upload used to upload the entire project, including the current config.ts), I can’t use this approach anymore. This is because Ionic Pro performs a
git checkout and builds from there, instead of the uploaded project, so
config.ts won’t exist and fail.
You can’t do a “file exists” with javacsript, so it’s not possible/reliable to try to load a config file in not async mode (and it’s not the purpose either in new standards) and overwrite variables.
I’d like to read suggestions on how do you guys deal with this