How do I have a build time parameter for my Ionic framework application?

I like to automate my processes, I like to have three distinct branches of my code. I'm developing an Ionic Framework based application however, I'd like to have configurations such as the server to connect to be changed based on a passed in parameter.

In C++ I can setup DEFINES which I can then use in the code to control various configurations. Does the Ionic Build system have a similar functionality?

Yes - you can use Hooks.

Hooks let you add a middleware functionality during the build phaze and are built with JavaScript.

There's a hook you can use to replace text on configuration files -

  1. Get the raplace.text.js hook and add it to your hook dir
  2. Create a configuration file with tokens per env

     {
    "stage":
           {
             "datahostname" : "'qa-api.mydomain.com'"
          },
    "prod":
          {
              "datahostname" : "'api.mydomain.com'"
          }
    }
    
  3. Put your token spread in files you want to make replacement at

  4. build with traget variable

TARGET=prod cordova build ios

check out this article to extend knowledge