{"id":14986868,"url":"https://github.com/angular-ru/angular-cli-webpack","last_synced_at":"2025-04-11T23:09:28.060Z","repository":{"id":57150875,"uuid":"123422960","full_name":"Angular-RU/angular-cli-webpack","owner":"Angular-RU","description":"Webpack configuration modifier for @angular/cli","archived":false,"fork":false,"pushed_at":"2019-02-03T21:39:43.000Z","size":121,"stargazers_count":67,"open_issues_count":4,"forks_count":5,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-11T23:08:51.336Z","etag":null,"topics":["angular","angular-cli","cli","coverage-status","css","ng","ngw","webpack","webpack-configuration"],"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/Angular-RU.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":"2018-03-01T10:57:46.000Z","updated_at":"2023-07-23T11:29:57.000Z","dependencies_parsed_at":"2022-08-31T20:01:39.339Z","dependency_job_id":null,"html_url":"https://github.com/Angular-RU/angular-cli-webpack","commit_stats":null,"previous_names":["angular-ru/ngw"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angular-RU%2Fangular-cli-webpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angular-RU%2Fangular-cli-webpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angular-RU%2Fangular-cli-webpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Angular-RU%2Fangular-cli-webpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Angular-RU","download_url":"https://codeload.github.com/Angular-RU/angular-cli-webpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248492868,"owners_count":21113163,"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","angular-cli","cli","coverage-status","css","ng","ngw","webpack","webpack-configuration"],"created_at":"2024-09-24T14:13:42.955Z","updated_at":"2025-04-11T23:09:28.022Z","avatar_url":"https://github.com/Angular-RU.png","language":"TypeScript","readme":"# Angular CLI Webpack (ngw)\n\n\u003e This package provides an opportunity to modify @angular/cli project's webpack configuration without [\"ejecting\"](https://github.com/angular/angular-cli/wiki/eject).\n\n[![Build Status](https://api.travis-ci.org/Angular-RU/angular-cli-webpack.svg?branch=master)](https://travis-ci.org/Angular-RU/angular-cli-webpack)  [![npm version](https://badge.fury.io/js/ngw.svg)](https://badge.fury.io/js/ngw) [![dependencies Status](https://david-dm.org/angular-ru/angular-cli-webpack/status.svg)](https://david-dm.org/angular-ru/angular-cli-webpack)\n[![Coverage Status](https://coveralls.io/repos/github/Angular-RU/angular-cli-webpack/badge.svg?branch=master)](https://coveralls.io/github/Angular-RU/angular-cli-webpack?branch=master) [![Coverage Status](https://img.shields.io/npm/dt/ngw.svg)](https://npm-stat.com/charts.html?package=ngw\u0026from=2017-01-12)\n\n## Installation\nFor angular 6/7:\n```bash\n$ npx -p @angular/cli ng new my-project \u0026\u0026 cd my-project # create new Angular CLI project\n$ npm i -D ngw # installing an improved cli-eject\n$ ./node_modules/.bin/ngw --set-up # run via terminal in project root\nSet up went successfully!\n```\nFor angular 5 use `npm i -D ngw@angular5`\n## Usage:\nLast command installation (ngw --set-up) makes three things:\n1) Changes scripts in package.json that starts from `ng ` to `ngw `\n2) Creates file `ngw.config.ts` in project root where you can redefine `webpack.Configuration` used by `@angular/cli`\n3) Sets `compilerOptions.module = \"commonjs\"` property in `tsconfig.json`\n\nSo just make changes to the webpack config in appeared `ngw.config.ts`\n\nYou may like to do `npm i -D @types/webpack` for better experience.\n\n## Example\n\n#### Removes unused selectors from your CSS\n\nThis little piece of code in your ngw.config [removes unused selectors from your CSS:](https://github.com/webpack-contrib/purifycss-webpack)\n\n```typescript\nconst PurifyCSSPlugin = require('purifycss-webpack');\nconst path = require('path');\nconst glob = require('glob');\n\nexport default function(config) {\n    config.plugins.push(\n      new PurifyCSSPlugin({\n        paths: glob.sync(path.join(__dirname, '**/*.html'))\n      })\n    );\n    return config;\n}\n```\n## Debugging\nYou may like to debug your configuration. \nThis can be done with [ndb](https://github.com/GoogleChromeLabs/ndb) package.\n1) Make sure that your development environment meets the requirements of `ndb`\n2) `npm i -g ndb`\n3) Add `debugger` keyword in `ngw.config.ts`\n4) `ndb npm run start`\n\n## Prod and dev mode modifications (ngw.config.ts)\n```typescript\n\nconst isProduction = process.argv.indexOf('--prod') !== -1;\n\nexport default function(config, options) {\n  //common config modification\n  ...\n  config = isProduction\n    ? productionModificationsMerged(config)\n    : devModificationsMerged(config);\n  }\n  ...\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-ru%2Fangular-cli-webpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangular-ru%2Fangular-cli-webpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-ru%2Fangular-cli-webpack/lists"}