ionic cordova build doesn’t build AOT at all even with either --prod or --aot or both, at least that’s true in CLI v.3.9.2 (and it hasn’t been building AOT since most of version 3). I had to use npm run ionic:build --prod to get ngc running. Anyone on the same boat?
When I made that comment, it was based on the fact that our app sizes were exactly the same building it with or without the --prod flag, the log outputs build dev started..., instead of ngc started and none of the optimization/minification steps are present in the logs. The app’s startup time peaks at 2 minutes because the JIT complier is trying to compile all our components in app.module.ts (we have a large app with over 500+ components).
Although soon after I had posted that reply today, I revisited the issue and figured out the culprit: We are running our builds on a locally installed version of the ionic CLI (we have multiple ionic apps to support and one of them breaks building with anything above version 2.x.x). So when we run ionic cordova build ios | android --prod, we are actually running the ionic inside node_modules/.bin that ignores any --prod or --aot flags and build all the apps in dev mode. Installing the CLI globally solves that issue.