How To Build and Publish an Angular Component Library

Writing a library, using it in local, publishing and use it in the apps

Bhargav Bachina
Bachina Labs

--

Photo by chuttersnap on Unsplash

Sometimes you need to extend the Angular functionality by creating Angular libraries. There are so many reasons for doing this: You have so many apps and you need to implement the same functionality in each app and these apps are separately maintained and deployed, Another reason would be you are a third-party vendor and you want to expose your product to the public, etc. A simple example might be a button that sends users to your company website, that would be included in all apps that your company builds.

The entire guide is already well documented on the Angular site here. What I would like to demonstrate here is the entire process with example projects. First, we create a simple library and see all the necessary steps, and then, we will see how to publish, versioning, and import in different apps.

  • What are we building?
  • Example Projects
  • Creating a Library
  • How To Use In Local Environment
  • Important things to consider
  • Publishing a Library
  • Versioning
  • Import and use it

--

--