Registry / devops / angular-library-builder

angular-library-builder

JSON →
library1.6.3jsnpmunverified

CLI tool to build Angular (2+) libraries ready for npm publishing. Current stable version is 1.6.3 (last release). Development appears stalled with no recent updates; alternative official tool is @angular/cli's library support. Key differentiator: inlines HTML templates and CSS styles into components and uses @angular/compiler-cli for compilation. Requires Node >=6 and is not compatible with Angular versions beyond 8.

npm install angular-library-builder
INSTALL
IMPORT
SIG · ANGULAR-LIBRARY-BU
A
angular-library-builder
devopsjavascriptv1.6.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

nglb
npx nglb --rootDir src/lib --outDir lib-dist
nglb (without npx or local install)
nglb is a CLI command; it is not imported. It must be run via npx or as a npm script.

Shows installing the package, configuring package.json, running the build, and publishing to npm.

npm install --save-dev angular-library-builder # Add to package.json: # "main": "./lib-dist/your-main-file.js", # "types": "./lib-dist/your-main-file.d.ts", # "scripts": { # "build:library": "nglb --rootDir src/lib --outDir lib-dist" # } npm run build:library npm publish
Debug
Known issues
gotchaThe tool only supports Angular versions < 9 (Angular 8 and below). For Angular 9+ use the official Angular CLI library generation (ng generate library).
fix
Migrate to Angular CLI's ng generate library for Angular 9+.
affects: >=1.0.0
gotchaThe --rootDir and --outDir options are required; they must point to the correct directories relative to the project root.
fix
Ensure --rootDir points to the library source (e.g., src/lib) and --outDir to a dist folder (e.g., lib-dist).
affects: >=1.0.0
gotchaThe tool does not support Angular's Ivy compiler; it uses View Engine (ngc).
fix
Use Angular CLI for Ivy compatibility.
affects: >=1.0.0
deprecatedThe tool is not actively maintained; last release was in 2019. Consider using @angular/cli's library support or ng-packagr.
fix
Use Angular CLI's ng generate library for new libraries.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module '@angular/compiler-cli'
Missing peer dependency @angular/compiler-cli.
fix
npm install --save-dev @angular/compiler-cli
Error: The rootDir option is required
Missing --rootDir argument when running nglb.
fix
Include --rootDir with a valid path, e.g., nglb --rootDir src/lib --outDir lib-dist
Upgrade
Version history
1.6.3latest on npm
Audit
Dependencies
@angular/compiler-clirequiredrequired for ngc compilation
Agent activity
28 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
angular-library-builder — npm install angular-library-builder · libregistry