joanllenas / ngx-date-fns

⏳ date-fns pipes for Angular
163 stars 14 forks source link

Use Single Pipe Angular Module for exporting pipes #342

Closed KingDarBoja closed 3 years ago

KingDarBoja commented 3 years ago

This PR does not change the behaviour of the library itself but enables selectively importing pipes as modules, instead of relying on DateFnsModule.forRoot() as requested by #215. Take a look at https://indepth.dev/emulating-tree-shakable-components-using-single-component-angular-modules to know more about this approach.

The library itself is already tree-shakable as all imports from date-fns are correctly imported as stated on the official docs: https://date-fns.org/v2.16.1/docs/ECMAScript-Modules

Also made few changes in order to provide a better dev setup like pointing to the build package on the example app by modifying the paths field on tsconfig.json file.

Cheers! 🚀

joanllenas commented 3 years ago

Hi @KingDarBoja , this looks really good! I needed someone with the skills to look into that particular issue. I'll review your PR later this week; I'm on a trip right now. Cheers!

joanllenas commented 3 years ago

The new version has been released

Thanks!