You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compile and package Angular libraries in Angular Package Format (APF)
Installation
npm install -D ng-packagr
Usage Example
Let's walk through a getting started that'll build an Angular library from TypeScript sources and create a distribution-ready npm package:
create a ng-package.json file and run ng-packagr -p ng-package.json
β Here we go:
Now, execute the build with the following command:
$ yarn build
The build output is written to the dist folder, containing all those binaries to meet the Angular Package Format specification.
You'll now be able to go ahead and npm publish dist your Angular library to the npm registry.
Do you like to publish more libraries?
Is your code living in a monorepo?
Create one package.json per npm package, run ng-packagr for each!
Packaging Angular Libraries - Jason Aden at Angular Mountain View Meetup (Jan 2018, 45min talk)
Create and publish Angular libs like a Pro - Juri Strumpflohner at NG-BE (Dec 2017, 30min talk)
Packaging Angular - Jason Aden at ng-conf 2017 (28min talk)
Create and publish Angular libs like a Pro - Juri Strumpflohner at ngVikings, this time demoing building Angular libraries with ng-packagr, with NX as well as Bazel (March 2018, 30min talk)
To orchestrate the different tools, ng-packagr features a custom transformation pipeline. The transformation pipeline is built on top of RxJS and Angular Dependency Injection concepts.
About
Compile and package Angular libraries in Angular Package Format (APF)