How to setup a test env at build time using ionic 3

I have a delimma involving creating a test, dev, prod environment using ionic.

I want to do this: ionic cordova build iOS --prod or ionic cordova build iOS --test (same with Android builds).

This is easy to do in Angular 5 code, as I just edit the various src/environment.test.ts or src/envirnment.prd.ts, and then place these filenames in the angular.json.

How do I do something similar in ionic. According my package.json in ionic, I am using ionic-angular 3.9.2