I am using Ivy latest rc candidate so far.
Use Case: I want to provide several modules which are compiled separately loadable via the import statement on runtime without using the loadchildren from the router module.
Context: I have created a library called nodes via "ng generate library nodes". "ng build nodes" generates under dist the desired bundles etc. Nothing special so far.
In my app I want to instantiate the NodesComponent as follows:
const modulePath = '/Users/modules/nodes/nodes.umd.js'; return await import(modulePath).then(...)
This does not work as the Ivy compiler somehow does not recognize the module to be loaded on demand.
When calling
import('/Users/modules/nodes/nodes.umd.js').then(...) it works as expected.
Question:
Is it possible to load an arbitrary module file from a location with import WITHOUT specifying the modulePath @compile time ?
It should be possible with Ivy to lazy load modules from any location without specifying them on compilation time.