Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 3 Lazy loading plugins

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?

like image 586
jonas-l-b Avatar asked Dec 01 '25 06:12

jonas-l-b


1 Answers

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.

like image 154
Jean Guzman Avatar answered Dec 02 '25 20:12

Jean Guzman