Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic 3 deployment --release build much slower than --prod

There are several ways to build with ionic 3, which are not really explained in detail in the docs: https://ionicframework.com/docs/intro/deploying/

The start time of my app varies drastically with the different builds:

ionic cordova run android --release -> app start time 8 seconds

ionic cordova run android --prod -> app start time 3 seconds

ionic cordova run android --prod --release -> app start time 8 seconds

Would there be any reason for me not to build with just --prod? And if yes, what could I do to make --prod --release faster? (8 seconds is a not acceptable start up time for my pretty lightweight app) Is it true that I won't be able to deploy to Google Play Store without the --release option?

like image 463
Rich Steinmetz Avatar asked Mar 08 '23 04:03

Rich Steinmetz


1 Answers

You need to differenciate between the two flags: --release is a flag used by the cordova CLI while --prod is a flag that is use by the ionic CLI. So what are those flags doing?

--prod is an alias for all of the following flags:

  • --optimizejs
  • --minifycss
  • --aot
  • --minifyjs

And is responsible for minifying and optimizing your .js bundle -> this is what makes your app startup faster because the browser needs to parse and interpret less code.

--release tells cordova it should build a optimized release .apk which you can sign and upload to Google-Play.

like image 168
David Avatar answered Mar 16 '23 14:03

David