How to lazy load angular core modules like FormsModule?

15 views
Skip to first unread message

Lucas Pelegrino

unread,
Mar 20, 2020, 2:00:17 PM3/20/20
to Angular and AngularJS discussion
Hey guys.

I have a module that is loaded dynamically (lazily) when a user clicks a link, that module imports angular's core FormsModule and everything works fine.


The problem is I'm trying to make my bundle size as small as possible, and I noticed angular bundles the @angular/forms in the main.js, even tho there is no one importing it besides the feature module above.


I have some code example here: https://stackoverflow.com/questions/60748482/how-to-lazy-load-angular-core-modules-formsmodule?noredirect=1


Is this expected behavior? Shouldn't FormsModule be lazily loaded together with the feature module?

Reply all
Reply to author
Forward
0 new messages