Config files for dev and prod, out of repo, for Ionic Pro

Hi.

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.sample => 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 :slight_smile:

Thanks!

1 Like

Interesting question.

Ionic Pro is a hosted and closed source service, so there is not much we, the community, can help you with, sorry. Check these:

You can - and should - contact support at http://ionicframework.com/support#support

Thanks. I think I’ll be creating a ticket for this in the support area. Maybe there’s a good approach to solve this.

1 Like

Let us know if you get an answer (positive or negative…)