Ionic 3 lazy loading plugins

So with Ionic 3, lazy loading of pages and components was introduced into the framework. I have an app optimized to lazy load all pages, but it still has slow startup times. However, I use a lot of plugins that I think might be causing this slow startup.

Now in Ionic, native plugins are wrapped in Angular, so it would also be possible to lazily load plugins so that plugins that might only come into play at certain points in the application are not loaded until there is a need to improve loading?

+3


source to share


2 answers


I think you can remove the native plugins from the main application .module.ts and add it to the component module that the plugin actually uses. This way the plugin will only be called when the module is loaded.



+6


source


You don't need to add a lazy loading plugin. Go to your app.componer.ts file , just change rootPage: any = HomePage; on rootPage: string = "HomePage"; ... You don't need to import the file.



-2


source







All Articles