I'm looking for a way to lazy load a module that doesn't contains any components but services only. The background: in my app is an Excel export service using exceljs
library. This library is extremely large and I'm trying to prevent that the library will become part of vendor.js
or main.js
. It is "included" via import * as Excel from 'exceljs/dist/exceljs.min.js'
in a service.
Now I have several components in separate modules that make use of the "Excel export" service (no component). I would prefer a method that the service is only loaded if the user is "clicking the export button" but not before.
How this can be done?