enableProdMode() question

My App is on beta.8.

Doing

export class MyApp {
  rootPage: any = HomePage;

  constructor(platform: Platform) {
    if (platform.is('ios')
      || platform.is('android')
      || platform.is('windows')) {
      enableProdMode();
    }
  }

Results in

ORIGINAL EXCEPTION: Cannot enable prod mode after platform setup.

ionicBootstrap(MyApp, [], {prodMode: true}); works of course, but it’d better to activate prod mode only when the app is running on a device since dev mode can be useful during development.

Angular 2’s cli can trigger prod mode from the command line

ng serve -prod
vs.
ng serve -dev

I was hoping similar option for

ionic serve
ionic run
ionic build 
etc.
4 Likes