then you can run ionic build android --prod or call npm run build
you can also create platform specific scripts by copying and customizing configurations from node_modules/@ionic/app-scripts/config, for example to remove all non material design CSS or some unneeded fonts from final package:
@alfabetagama thx for your answer, that would explain why I could achieve it on iOS May not be a solution for me then, as much as possible, want to stick to the same solution for both iOS and Androi
@brunosmartin yes you’re right, it’s possible to do lazy loading with Ionic 3.
But is, in my point of view, not yet mature. The major reason behind that is that code, of components, may most probably duplicated in your different bundles.
If you app is only accessible via a login, there is an interesting post with some ideas about how to design the root pages and services. It allowed me to save some ms:
Hello @alfabetagama, We used ionic v2.2.0 and typescript v1.0.0 and made 14-15 features in my app and also used 8-10 ionic plugins which is used in application. My app takes 20-22 sec to load app in android and ios device. so, my question is why it takes that much time? Do you know about Lazyloading or any preloading technique so we can reduce app load time… we used ionic build android --prod --release command to generate .apk file. Please help me… thank you
Hello @reedrichards, We used ionic v2.2.0 and typescript v1.0.0 and made 14-15 features in my app and also used 8-10 ionic plugins which is used in application. My app takes 20-22 sec to load app in android and ios device. so, my question is why it takes that much time? Do you know about Lazyloading or any preloading technique so we can reduce app load time… we used ionic build android --prod --release command to generate .apk file Please help me… thank you
A note to use loading page: this only gonna work on a website not an app. I tried to fully suppress the splash screen and build my own html splash, but unfortunately I noticed that on iOS or Android, don’t remember exactly, the splash screen is mandatory, and therefore, if not provided, it just made the experience of the app booting without splash screen on the device a bit ugly and weird
thx for the clarification, I should maybe give a try
last time I tried, when I was adding a loading spinner in index.html, the solution wasn’t acceptable because I had the feeling that a cordova splash screen was a must on iOS, but like you said, maybe by deferring the loading that would solve it…
The Ionic team published yesterday a blog post about the upcoming Stencil project. A particular sentence might be promising about boot time
All these benefits will also be shipping with the next release of Ionic-Angular, v4.0.0, with only minimal breaking changes. With the built-in code splitting and smaller bundles that comes with web components built with Stencil, we greatly improve the load time performance
I don’t think that is a valid solution, loading all components in app.module.ts would mean loading all components at boot time which is kind of the opposite of the goal of the lazy loading concept