Greetings.
We use Aurelia 1 + dumber bundler.
We have a module which has rather heavy dependencies which we keep in a separate bundle, so in some cases we want to load it lazily.
This means NOT using import
to import its constructor.
The module itself has some dependencies resolved via resolve(Dependency)
.
I tried the following approaches:
Loader
vialoader.load("./path/to/module")
: this loads the whole module of which the class constructor is a property; this is not enough because we cannot construct an instanceContainer
viacontainer.get("./path/to/module")
: this seems allowed by TypeScript but it does not work since it just resolves the passed string (I reiterate, we do not have access to the constructor function here).
Therefore, is there any way to lazily resolve a module by name without explicitly requiring it? (This is conceptually similar to what the router does with page paths.)