App config prodMode not working

I read http://ionicframework.com/docs/v2/api/decorators/App/ to enable the production mode Angular 2 for that I write

@App({
  templateUrl: 'build/app.html',
  config: {
     prodMode:true
  } 
})

no change happens .still its show bellow message in chrome console .

Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.

Close! prodMode is not a property of the config object, but of the app decorator.

@App({
  template: '<ion-nav [root]="rootPage"></ion-nav>',
  config: {},
  prodMode: true
})

I made a mistake like a fool.thankx for pointing me.

1 Like

in which file we have to impliment this… i am using ionic 2 latest version

This would already be taken care of, when calling ionic build <platform> --prod

The --prod will

  • Enable production angular builds
  • Perform AOT on you templates
  • Minify/uglify your code

All screens are blank in Android if I run app with –prod option. (Please see my post https://forum.ionicframework.com/t/ionic-run-prod-white-screeen/73398/19) I have also tried to start a new --v2 ionic app and migrated my code to its new structure. But --prod option generates an app whose screen are all blanks. I have tried also to remove plugins and add one by one. Nothing seems to solve. Please help!!!

I finally have found the answer to my problem. In fact, the answer was this post: Ionic app show blank screen on android device (4.4.4) after splash screen I have added new color variables to my variables.scss file and when I run --prod build all screens get blank. Now I need to know how to add my new color variables.