A template repository for Angular libraries
Find and replace all %PROJECT_NAME%
with your project name, you should also rename the /projects/PROJECT_NAME
folder and update .eslintrc.js > parserOptions > project
property accordingly.
[!IMPORTANT] Make sure to update angular to the latest version
This template repository consists of 2 angular projects which split the responsibility of developing vs publishing only what's needed:
<root>/src
like any other normal angular projectprojects/PROJECT_NAME
and is the actual library you can put on NPMlibrary
in the angular.json
package.json
& tsconfig
that extends the main oneng-package.json
for ng-packagr to usePay attention to /package.json
, /angular.json
& projects/example-lib/package.json
since they define how the development environment will be set up compared to what will be published onto NPM.
Run npx ng build
to build the library project using ng-packagr. The build artifacts will be stored in the dist/%PROJECT_NAME%/
directory.
Run npm publish
in the dist/%PROJECT_NAME%/
directory in order to publish the library to a package registry.