{"id":40950389,"url":"https://github.com/gcirone/ngx-build-plugin","last_synced_at":"2026-01-22T05:11:15.248Z","repository":{"id":39559259,"uuid":"171570426","full_name":"gcirone/ngx-build-plugin","owner":"gcirone","description":"Enhance Angular CLI's default build configuration by plugging a custom one.","archived":false,"fork":false,"pushed_at":"2023-01-07T03:17:54.000Z","size":3089,"stargazers_count":2,"open_issues_count":24,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T02:46:17.748Z","etag":null,"topics":["angular","cli","plugin"],"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/gcirone.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":"2019-02-20T00:08:58.000Z","updated_at":"2020-12-09T12:18:19.000Z","dependencies_parsed_at":"2023-02-06T11:01:29.755Z","dependency_job_id":null,"html_url":"https://github.com/gcirone/ngx-build-plugin","commit_stats":null,"previous_names":["gcirone/ngx-build-plugins"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/gcirone/ngx-build-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcirone%2Fngx-build-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcirone%2Fngx-build-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcirone%2Fngx-build-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcirone%2Fngx-build-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gcirone","download_url":"https://codeload.github.com/gcirone/ngx-build-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcirone%2Fngx-build-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28655270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","cli","plugin"],"created_at":"2026-01-22T05:11:14.516Z","updated_at":"2026-01-22T05:11:15.236Z","avatar_url":"https://github.com/gcirone.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ngx Build Plugin\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/ngx-build-plugin\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/ngx-build-plugin.svg?style=flat-square\" alt=\"Npm\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://circleci.com/gh/gcirone/ngx-build-plugin\"\u003e\n    \u003cimg src=\"https://circleci.com/gh/gcirone/ngx-build-plugin.svg?style=shield\" alt=\"CircleCI Build Status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/facebook/jest\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/tested_with-jest-99424f.svg?style=flat-square\" alt=\"Jest\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/gcirone/ngx-build-plugin\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/gcirone/ngx-build-plugin/branch/master/graph/badge.svg\" alt=\"Codecov\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nEnhance Angular CLI's default build configuration by plugging a custom one.\n\nThis package gives **low-level** access to the default configuration without providing a webpack merge behavior. Feel free to add your specific use case without limitations.\n\n\n## Installation\n\n*In the commands below I'll use [yarn](https://yarnpkg.com) but you could use [npm](https://www.npmjs.com) instead.*\n\n```\nyarn add -D ngx-build-plugin\n```\n\n## Usage\n\n- In your `angular.json` file:\n  ```\n  \"architect-target\": {\n    \"build\": {\n      \"builder\": \"ngx-build-plugin:browser\",\n      \"options\": {\n        \"plugin\": \"config/ng-build.config.js\",\n        ...\n      }\n    }\n  }\n  ```\n  Where:\n  - `builder` support one of the following builders [[browser](#browser)|[server](#server)|[dev-server](#dev-server)].\n  - `plugin` (**required**) should contain a valid path for the javascript plugin file relative to the **workspace root**.\n\n- Then run the build architect like this:  \n  `ng [architect-target]` or `ng run [project]:[architect-target]` \n\nIt's possible to change the plugin javascript file by using the `--plugin` switch:\n\n`ng [architect-target] --plugin other-path/ng-build.config.js`\n\n## Builders\n\n - [ngx-build-plugin:browser](#browser)\n - [ngx-build-plugin:server](#server)\n - [ngx-build-plugin:dev-server](#dev-server)\n \n\n## Plugin\n\nThe plugin empowers you to change the default webpack **config** by hooking  it before running the builder architect, so it's possible to full override if needed. \n\nIn addition, the plugin provides **pre** and **post** hook for tasks that need to happen before and after building.\n\nFor example:\n```javascript\nmodule.exports = {\n  pre(builderConfig) {\n    console.log('pre');\n  },\n  config(webpackConfig) {\n    console.log('config');\n    return webpackConfig;\n  },\n  post(builderConfig) {\n    console.log('post');\n  }\n}\n```\n\n*PS: The plugin concept is based on the [ngx-build-plus](https://www.npmjs.com/package/ngx-build-plus) package approach created by [@ManfredSteyer](https://twitter.com/ManfredSteyer)* \n\n## Examples\n\nA few examples that show the `ng-build-plugin` usages:\n\n### Change build progress plugin\n\nUse a progress bar plugin for webpack ([progress-bar-webpack-plugin](https://www.npmjs.com/package/progress-bar-webpack-plugin)).\n\n```javascript\nconst ProgressBarPlugin = require('progress-bar-webpack-plugin');\n\nmodule.exports = {\n  config(webpackConfig) {\n    webpackConfig.plugins.forEach((plugin, index) =\u003e {\n      if (plugin.constructor.name === 'ProgressPlugin') {\n        webpackConfig.plugins[index] = new ProgressBarPlugin();\n      }\n    });\n\n    return webpackConfig;\n  }\n}\n```\n\nTo execute this plugin check the [usage](#usage) above.\n\n*Note: no webpack merge plugin used just plugin instance replace.*\n\n### Use custom webpack merge strategy\n\nIt's possible to use [webpack-merge](https://www.npmjs.com/package/webpack-merge) with different strategy based on your specific use case:\n\n```javascript\nconst merge = require('webpack-merge');\nconst webpack = require('webpack');\n\nmodule.exports = {\n  config(webpackConfig) {\n    const strategy = merge.strategy({\n      externals: 'append',\n      plugins: 'prepend'\n    });\n\n    return strategy (webpackConfig, {\n      externals: [/^@angular/],\n      plugins: [\n        new webpack.DefinePlugin({\n          VERSION: JSON.stringify('1.0.1')\n        })\n      ]\n    });\n  }\n};\n```\n\nTo execute this plugin check the [usage](#usage) above.\n\n## Changelog\n\n[GitHub Releases](https://github.com/gcirone/ngx-build-plugin/releases)\n\n## Contributing\n\nThank you for contributions!\n\n### Feature Implementing\n\nPlease use GitHub Pull Requests.\n\nThere are some scripts to help developments.\n\n- `yarn build` - Make *build/package* directory from src directory.\n- `yarn build:watch` - Watch for files changes and rebuild package directory.\n- `yarn build:clean` - Delete directories which are created by other commands.\n- `yarn test` - Run tests and collect coverage (html report in *build/coverage*).\n- `yarn test:watch` - Run tests when each file was modified.\n- `yarn lint` - Run TSLint.\n- `yarn prettier` - Run Prettier.\n\n## License\n\nngx-build-plugin is [MIT licensed](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcirone%2Fngx-build-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcirone%2Fngx-build-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcirone%2Fngx-build-plugin/lists"}