[Debate] Ionic 2 environment development variables setup?

Hi, i’m using some setups explained in this file to setup the development environment for web servers, web apps and so (like angular 2 spa’s):
Setting up your development environment By luchillo17

But what about Ionic 2 apps? we can’t rely on Env variables in the servers, which most likely will be one pc, your pc.
Also we can’t rely on the host of the web spa, as ionic variables run in it’s own browser, i think if we ask the ionic browser for the host it most likely will return localhost maybe?

My proposal has to do with the version control methodology git-flow.

The plan is simple, set up a few gulp tasks that replace a few config variables for dev, test and prod, and using git hooks to trigger such tasks when creating release branches (Which for my team is equivalent to a test env), and when finishing a release branch and merging to master, trigger the prod task of that gulp file to replace the production variables.

Any ideas or better ways of doing so?

Update: relate to Environment Variables in AngularJS and Ionic.

I think this should be part of the framework.

Here are some links to help :