How Open Source can change your life

Santosh Yadav

GDE for Angular, GitHub Star, Auth0 Amabassador

Co-founder This is Learning

 

twitter.com/SantoshYadavDev

github.com/SantoshYadavDev

https://www.linkedin.com/in/SantoshYadavDev/

santoshyadav.dev

 

What is Nx

Nx is a mono-repo tool

Nx is a more than mono-repo you can extend it and configure it as per your use-case

You can build your own tool  

Why Libraries

Code reusability

Code sharing

Enables refactoring and adding new feature

Easy to distribute Code Review responsibility

Avoid Circular Dependency

Allows to add code owners

Speedup build time using incremental build

Creating Libraries

Adding Angular Libraries

npx nx generate library <lib-name>

Ways to create libraries

By default, libs are not buildable

Buildable libraries

Publishable libraries

Secondary Entrypoints

Why

With Angular Libraries you get single entrypoints.

Even a single module or component import will add huge chunk to bundle

How

Secondary Entrypoints adds only what is imported

To configure secondary entrypoints add ng-package.json to folder

nx g library-secondary-entrypoint <sec-name>

Thanks to My GitHub Sponsors

https://github.com/fahadqazi

https://github.com/ssunils

https://github.com/jackbridger

 

twitter.com/SantoshYadavDev

github.com/SantoshYadavDev

https://www.linkedin.com/in/SantoshYadavDev/

santoshyadav.dev

 

Thank you