jesusbotella/ngx-lazy-load-images

Huge bundle size

dsozzi opened this issue · 4 comments

Hi,

I've implemented the library and imported in my appModule as described in the readme. When I create a prod budle using ng build --prod the finale bundle size is double compared to the one without the library imported. It seems you are importing the entire Angular core again. Am I doing something wrong?
I'm currently using angular 7.0

thanks

Could you provide an example project where this issue is happening? :)

Hi,

here is the repo:

https://github.com/dsozzi/lazy-test

run ng build --prod with and without the library import and check the bundle size difference.

Image and video hosting by TinyPic

and I should add that the more the app grows in terms of bundle size, the more the library takes space. For example, in my current project, the bundle size without the library is 400 kb, with the library 780 kb. I expected to always be the same size (170kb) as shown above

Thank you for your issue.
I have just released a new version with Angular 11 support, please upgrade your ngx-lazy-load-images dependency in package.json to ^2.0.0.

If you encounter any problems while using it, please open a new issue.