I think there is a way to mitigate this issue, but this implies more work from the developer.
If we don’t want to include the component in the main bundle, we can put it in its module and in the directive, based on some conditions, you can load the module on demand by using import(path/to/module).then() and injecting the compiler.
No, you’re right.
I think there is a way to mitigate this issue, but this implies more work from the developer.
If we don’t want to include the component in the main bundle, we can put it in its module and in the directive, based on some conditions, you can load the module on demand by using import(path/to/module).then() and injecting the compiler.
Yeah like you wrote, another way would be to lazy-load the components of it, there are some helper libaries for this.
I also have one 😁
Lazy Loaded Components - #4 NPM-Package
negue ・ Dec 25 ・ 2 min read
Thanks for sharing!
I’m skeptical about libraries, but I do like to explore them!