1
votes

I have an application created in ionic which is much big in size and without lazy loaded pages. it contains over 30 pages and over 100 components. The problem is generated main.js is very big in size even after production build it is taking 5-6 seconds to load. Adding lazy loading to every page will cause lots of rework. so what i wanted to do is create different module named splashModule which contains html and js for complex animation. and i want to bootstrap it via platformBrowserDynamic and then after some seconds i want to bootstrap my original app. but doing so includes code of both module in main.js file. I want to lazy load second module per need basis. so can you please guide me how to do that?

Application is in ionic v3 framework.

1

1 Answers

0
votes

A way that comes to mind is to build the whole app as a lazy module, and load it after a delay. E.g. index.html is your "light" angular page, which after fancy loading, has setTimeout(() => this.router.navigate('home'), and app is, in your main module, the home for the "real" app. Did you try something like that?