{"id":15295278,"url":"https://github.com/bmvantunes/angular-library-builder","last_synced_at":"2025-10-07T06:31:42.574Z","repository":{"id":57178100,"uuid":"82419235","full_name":"bmvantunes/angular-library-builder","owner":"bmvantunes","description":"[DEPRECATED] - CLI Tool to build Angular (2+) libraries and publish them to npm","archived":true,"fork":false,"pushed_at":"2018-04-29T16:10:20.000Z","size":72,"stargazers_count":22,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-27T09:27:52.234Z","etag":null,"topics":["angular","angular2","builder","compiler","libraries","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmvantunes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-18T22:10:41.000Z","updated_at":"2023-01-29T21:45:09.000Z","dependencies_parsed_at":"2022-09-14T02:31:14.534Z","dependency_job_id":null,"html_url":"https://github.com/bmvantunes/angular-library-builder","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmvantunes%2Fangular-library-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmvantunes%2Fangular-library-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmvantunes%2Fangular-library-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmvantunes%2Fangular-library-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmvantunes","download_url":"https://codeload.github.com/bmvantunes/angular-library-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219877361,"owners_count":16554882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular2","builder","compiler","libraries","typescript"],"created_at":"2024-09-30T17:09:18.692Z","updated_at":"2025-10-07T06:31:42.188Z","avatar_url":"https://github.com/bmvantunes.png","language":"TypeScript","readme":"⛔️ [DEPRECATED] - @angular/cli version 6.0.0 has support for libraries\n\n[![Build Status](https://travis-ci.org/bmvantunes/angular-library-builder.svg?branch=master)](https://travis-ci.org/bmvantunes/angular-library-builder)\n[![dependencies Status](https://david-dm.org/bmvantunes/angular-library-builder/status.svg)](https://david-dm.org/bmvantunes/angular-library-builder)\n[![devDependencies Status](https://david-dm.org/bmvantunes/angular-library-builder/dev-status.svg)](https://david-dm.org/bmvantunes/angular-library-builder?type=dev)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![npm version](https://badge.fury.io/js/angular-library-builder.svg)](https://badge.fury.io/js/angular-library-builder)\n[![codecov](https://codecov.io/gh/bmvantunes/angular-library-builder/branch/master/graph/badge.svg)](https://codecov.io/gh/bmvantunes/angular-library-builder)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Greenkeeper badge](https://badges.greenkeeper.io/bmvantunes/angular-library-builder.svg)](https://greenkeeper.io/)\n\n# What is Angular Library Builder (nglb)?\n\nIt's a CLI Tool to build Angular (2+) libraries ready to be published to [npm](https://www.npmjs.com/).\n\n### What problem is Angular Library Builder (nglb) trying to solve?\n\nAt the moment there is no official documentation/guidelines on how to build and publish Angular (2+) components/libraries/services/modules to npm. Angular Library Builder (nglb) is trying to solve this in the easiest way possible.\n\n### How does Angular Library Builder (nglb) solve this?\n\n1. If it is a component, inlines html template file into the component as a string, replacing `templateUrl` with `template`\n    - In the inlining process nglb also minifies html using [html-minifier](https://www.npmjs.com/package/html-minifier)\n2. If it is a component, inlines scss/sass/css file(s) into the component as a string, replacing `stylesUrls` with `styles`. It uses:\n    - [node-sass](https://www.npmjs.com/package/node-sass) to compile scss/sass file(s) \n    - [autoprefixer](https://www.npmjs.com/package/autoprefixer) to improve browser compatibilty\n    - [csso](https://www.npmjs.com/package/csso) to minimize/optimize your css\n3. Finally, it compiles your resulting typescript files with all your html and css inlined, using @angular/compiler-cli (ngc), creating `*.d.ts`, `*.js`, `*.js.map`, `*.metadata.json` files\n\n# Getting Started\n\n#### Install the `angular-library-builder` command\n\n```sh\nnpm install --save-dev angular-library-builder\n```\n\n#### How to use `angular-library-builder`?\n\nAdd angular-library-builder (nglb) script, main and types to `package.json`:\n\n```json\n\"main\": \"./lib-dist/your-main-file.js\",\n\"types\": \"./lib-dist/your-main-file.d.ts\",\n\"scripts\": {\n  \"build:library\": \"nglb --rootDir src/lib --outDir lib-dist\"\n}\n```\nor\n```json\n\"main\": \"./lib-dist/your-main-file.js\",\n\"types\": \"./lib-dist/your-main-file.d.ts\",\n\"scripts\": {\n  \"build:library\": \"angular-library-builder --rootDir src/lib --outDir lib-dist\"\n}\n```\n\nNow, in your project root:\n```sh\nnpm run build:library\n```\n\nCongratulations! Your library is available in lib-dist folder ready to be published to npm.\n\nTo publish your new library to npm, execute the following command in your project root: \n```sh\nnpm publish\n```\n\n#### Options that `angular-library-builder` supports\noption (argument) | description\n------------ | -------------\n--rootDir | Specifies the root directory of input files. Example: ```nglb --rootDir src```, [required]\n--outDir | Redirect output structure to the directory. Example: ```nglb --outDir dist```, [required]\n--tsconfig | Possibility to extend/override properties in default [tsconfig-ngc.json](https://github.com/bmvantunes/angular-library-builder/blob/master/tsconfig-ngc.json). Example: ```nglb --tsconfig path/to/your/override-tsconfig-ngc.json```\n--help (-h) | Print help message\n\n\n# How to change `angular-library-builder` [tsconfig-ngc.json](https://github.com/bmvantunes/angular-library-builder/blob/master/tsconfig-ngc.json) default properties?\nSometimes the defaults aren't good enough for everybody.\n\n#### Example\nLet's imagine that you want to change slightly the build process:\n1. change the default \"target\" from \"es5\" to \"es2015\"\n2. add a new property, for example, \"noImplicitAny\": true,\n\nTo acomplish this create a file called, for example, ```override-tsconfig-ngc.json``` in your project root.\nYour ```override-tsconfig-ngc.json``` file can be something like:\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"es2015\",\n    \"noImplicitAny\": true\n  }\n}\n```\n\nThen, you invoke nglb like this:\n```bash\nnglb --rootDir path/to/your/source --outDir path/to/dist --tsconfig override-tsconfig-ngc.json\n```\n\n# Authors and Contributors\n\n@bmvantunes (Bruno Antunes, author)\n\nSpecial thanks to [gulp-inline-ng2-template](https://github.com/ludohenin/gulp-inline-ng2-template). Without [gulp-inline-ng2-template](https://github.com/ludohenin/gulp-inline-ng2-template) `angular-library-builder` would not be possible!\n\n# License\n\nThe repository code is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmvantunes%2Fangular-library-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmvantunes%2Fangular-library-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmvantunes%2Fangular-library-builder/lists"}