From 3915d6915c449530d5016e94aada10ce24ae890d Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Fri, 27 Apr 2018 14:42:01 +0300 Subject: [PATCH] build(aio): add support for faster, unoptimized `serve` When running `yarn start` and `yarn serve-and-sync`, we are usually more interested in faster re-build times than optimized builds. This was also the behavior, before upgrading to @angular/cli@6 (fc5af69fb). This commit introduces a new configuration (`fast`), which is used by `yarn start` and `yarn serve-and-sync` to restore the faster, unoptimized builds. Other commands, such as `ng serve` and `ng e2e`, remain unchanged (using slower, optimized builds). --- aio/angular.json | 11 ++++++++--- aio/package.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/aio/angular.json b/aio/angular.json index fa0fe632e49df..7b55cfd846bd8 100644 --- a/aio/angular.json +++ b/aio/angular.json @@ -75,10 +75,12 @@ "input": "src/styles.scss" } ], - "scripts": [], - + "scripts": [] }, "configurations": { + "fast": { + "optimization": false + }, "next": { "fileReplacements": [ { @@ -111,6 +113,9 @@ "browserTarget": "site:build" }, "configurations": { + "fast": { + "browserTarget": "site:build:fast" + }, "next": { "browserTarget": "site:build:next" }, @@ -232,4 +237,4 @@ "prefix": "aio" } } -} \ No newline at end of file +} diff --git a/aio/package.json b/aio/package.json index 3c98130a5aa1f..6ee8b4c9f659e 100644 --- a/aio/package.json +++ b/aio/package.json @@ -12,7 +12,7 @@ "aio-use-npm": "node tools/ng-packages-installer restore .", "aio-check-local": "node tools/ng-packages-installer check .", "ng": "yarn check-env && ng", - "start": "yarn check-env && ng serve", + "start": "yarn check-env && ng serve --configuration=fast", "build": "yarn build-for stable", "prebuild-for": "yarn setup", "build-for": "yarn ~~build --configuration",