Reputation: 291
So with Ionic 3 lazy loading of pages and components was introduced into the framework. I have app optimized to lazy load all the pages now but it still has a slow startup time. I do however use a lot of native plugins which I think might be the reason for this slow start up.
Now in Ionic the native plugins are wrapped in Angular, so would it be possible to also lazy load the plugins so that the plugins, which might only come into play at certain moments of app usage, won't get loaded until necessary hence improving boot performance?
Upvotes: 3
Views: 1674
Reputation: 344
You don't need to add any plugin for lazy loading. Go to your app.componer.ts file just change rootPage:any = HomePage; to rootPage:string = "HomePage";. You don't need import your file.
Upvotes: -2
Reputation: 2202
I guess you could remove the native plugins from your main app.module.ts and add it to the component's module that's actually using the plugin. That way the plugin will only be called when the module it's loaded.
Upvotes: 7