Categories
Uncategorised

Working with Angular Libraries: Creating Library

This article navigates through the entire process of creating Angular Library, configuring Angular modules via dependency injection. and setting GitHub authentication in order to publish and read from its private NPM registry.

Creating Angular Library

To start a new package create workspace or use an existing one, for this one I will make a new one using the following command:

ng new domoe --no-create-application

then enter the workspace folder:

cd domoe

and finally, generate the library inside domoe workspace

ng generate library domoe-components

This will set up the library inside the `domoe/projects` folder.

The internal structure is as follows:

  • domoe/projects/domoe-components/
    • src
      • lib
      • public-api.ts
    • ng-package.json
    • package.json
    • tsconfig.lib.json
    • tsconfig.lib.prod.json

One reply on “Working with Angular Libraries: Creating Library”

Leave a Reply to eskei Cancel reply

Your email address will not be published. Required fields are marked *