From f41d2d8e1506651f8ec4f0a31006797647c70e91 Mon Sep 17 00:00:00 2001 From: ivanpadavan Date: Fri, 12 Oct 2018 21:11:53 +0300 Subject: [PATCH 1/7] Merge tag 'v6.0.9' into develop (#36) From c2de27442402029a94011c823a9faf5b53e51527 Mon Sep 17 00:00:00 2001 From: ivanpadavan Date: Fri, 12 Oct 2018 21:13:55 +0300 Subject: [PATCH 2/7] fix typo (#37) --- lib/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.ts b/lib/index.ts index ba1e677..64a1b80 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -35,7 +35,7 @@ function buildConfig(variant: string) { const options: WebpackOptions = { root: args[0], projectRoot: args[1], - options: args[-1] + options: args[args.length - 1] }; return interceptor(config, ...args); } catch (e) { From e56c3c5fe7cc798e7123e48546678db50d66253d Mon Sep 17 00:00:00 2001 From: ivanpadavan Date: Fri, 12 Oct 2018 21:18:01 +0300 Subject: [PATCH 3/7] new version (#38) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7452ed7..94cdc30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngw", - "version": "6.0.9", + "version": "6.1.0", "description": "Provides an opportunity to overload webpack config for angular-cli applications", "main": "lib/index.js", "typings": "lib/index", From efce9469026d25a9e4d115ed9164251c1db72cf5 Mon Sep 17 00:00:00 2001 From: ivanpadavan Date: Thu, 25 Oct 2018 12:14:12 +0300 Subject: [PATCH 4/7] update readme (#41) --- README.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 2a133a5..151d9e0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![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&from=2017-01-12) ## Installation -For angular 6: +For angular 6/7: ```bash $ npx -p @angular/cli ng new my-project && cd my-project # create new Angular CLI project $ npm i -D ngw # installing an improved cli-eject @@ -15,9 +15,10 @@ Set up went successfully! ``` For angular 5 use `npm i -D ngw@angular5` ## Usage: -Last command installation (ngw --set-up) makes two things: +Last command installation (ngw --set-up) makes three things: 1) Changes scripts in package.json that starts from `ng ` to `ngw ` 2) Creates file `ngw.config.ts` in project root where you can redefine `webpack.Configuration` used by `@angular/cli` +3) Sets `complierOptions.module = "commonjs"` property in `tsconfig.json` So just make changes to the webpack config in appeared `ngw.config.ts` @@ -43,24 +44,26 @@ export default function(config) { return config; } ``` +#### Debugging +You may like to debug your configuration. +This can be done with [ndb](https://github.com/GoogleChromeLabs/ndb) package. +1) Make sure that your development environment meets the requirements of `ndb` +2) `npm i -g ndb` +3) Add `debugger` keyword in `ngw.config.ts` +4) `ndb npm run start` #### Prod and dev mode modifications (ngw.config.ts) - ```typescript + +const isProduction = process.argv.indexOf('--prod') !== -1; + export default function(config, options) { //common config modification ... - switch(options.buildOptions.enviroment) { - case 'prod': - config = productionModificationsMerged(config); - break - case 'dev': - //etc + config = isProduction + ? productionModificationsMerged(config) + : devModificationsChane(config); } + ... } ``` - - -## Caution - -For complex cases it's more appropriate to use `ng eject` command. Default building process could be changed significanlty in further `@angular/cli` releases so your customization could break (or became broken). From 809ae71462ccd77326938d83eb5c54fbbce77b5a Mon Sep 17 00:00:00 2001 From: ivanpadavan Date: Thu, 25 Oct 2018 12:15:47 +0300 Subject: [PATCH 5/7] Update README.md (#42) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 151d9e0..b608346 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ export default function(config) { return config; } ``` -#### Debugging +## Debugging You may like to debug your configuration. This can be done with [ndb](https://github.com/GoogleChromeLabs/ndb) package. 1) Make sure that your development environment meets the requirements of `ndb` @@ -52,7 +52,7 @@ This can be done with [ndb](https://github.com/GoogleChromeLabs/ndb) package. 3) Add `debugger` keyword in `ngw.config.ts` 4) `ndb npm run start` -#### Prod and dev mode modifications (ngw.config.ts) +## Prod and dev mode modifications (ngw.config.ts) ```typescript const isProduction = process.argv.indexOf('--prod') !== -1; From 0ef4872dd8c52fa8ff042bae11cf707457d11a27 Mon Sep 17 00:00:00 2001 From: ivanpadavan Date: Thu, 25 Oct 2018 18:51:36 +0300 Subject: [PATCH 6/7] Update README.md (#43) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b608346..64085b0 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ For angular 5 use `npm i -D ngw@angular5` Last command installation (ngw --set-up) makes three things: 1) Changes scripts in package.json that starts from `ng ` to `ngw ` 2) Creates file `ngw.config.ts` in project root where you can redefine `webpack.Configuration` used by `@angular/cli` -3) Sets `complierOptions.module = "commonjs"` property in `tsconfig.json` +3) Sets `compilerOptions.module = "commonjs"` property in `tsconfig.json` So just make changes to the webpack config in appeared `ngw.config.ts` @@ -62,7 +62,7 @@ export default function(config, options) { ... config = isProduction ? productionModificationsMerged(config) - : devModificationsChane(config); + : devModificationsMerged(config); } ... } From ba3132a3824eae12a3efe844cf031d88b700a247 Mon Sep 17 00:00:00 2001 From: ivanpadavan Date: Fri, 26 Oct 2018 00:21:51 +0300 Subject: [PATCH 7/7] travis (#44) --- .travis.yml | 29 +++++++++++++++++++++-------- package.json | 9 ++++----- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2c0283..34b00bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,25 @@ +os: + - linux language: node_js -sudo: false +sudo: true node_js: - - "9.3" + - "10.12" install: - - npm install + - npm i + - npm run build + - rm -rf ./node_modules + - npm i --production +before_script: + - npm i -g @angular/cli + - set -e + - cp -rf "$PWD" ~/ngw + - cd ~ + - ng new test-project --skip-install --defaults=true + - cd test-project + - npm i + - cp -rf "../ngw" "./node_modules/ngw" + - ln -sr "./node_modules/ngw/bin/ngw" "./node_modules/.bin/ngw" script: - - npm run lint - - npm test - - npm build -after_success: - - npm run coverage + - "grep 'angular.*: \"' package-lock.json | sort -u" + - ./node_modules/.bin/ngw --set-up + - npm run build | fgrep ngw.config diff --git a/package.json b/package.json index 91b560a..accd0bb 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,11 @@ "homepage": "https://github.com/Angular-RU/ngw#readme", "peerDependencies": { "@types/node": "*", - "@types/webpack": "*", - "typescript": "^3.0.0" + "@types/webpack": "*" }, "dependencies": { - "ts-node": "^7.0.1" + "ts-node": "^7.0.1", + "typescript": "^3.0.0" }, "devDependencies": { "@angular-devkit/build-angular": "0.6.7", @@ -38,7 +38,6 @@ "@types/node": "^9.4.6", "@types/webpack": "^3.0.0", "tslint": "^5.8.0", - "tslint-config-standard": "^7.0.0", - "typescript": "^2.7.2" + "tslint-config-standard": "^7.0.0" } }