How Open Source can change your life

Santosh Yadav

GDE for Angular, GitHub Star, Auth0 Amabassador

Co-founder This is Learning


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


With Angular Libraries you get single entrypoints.

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


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


Thank you

Creating and Publishing Angular Libraries using Nx

By Santosh Yadav

Creating and Publishing Angular Libraries using Nx

  • 89