0Pricing
Angular Academy · Lesson

Publishing to npm

Version and publish your library.

Sharing Your Library with the World

Once built into the Angular Package Format, a library is published to a registry, usually npm, so any project can install it with npm install. This lesson covers versioning and the publish workflow.

Publish the dist Output, Not Source

You publish the built package in dist/<lib>, which contains the generated package.json and compiled bundles, never the raw source project. The build step is what makes it consumable.

ng build ui-kit --configuration production
cd dist/ui-kit

All lessons in this course

  1. Creating a Library with ng generate
  2. Public API and Entry Points
  3. Building with ng-packagr
  4. Publishing to npm
← Back to Angular Academy