From 1ca1fcd5638a09bcec8fb11e4457238723e47013 Mon Sep 17 00:00:00 2001 From: Bram Borggreve Date: Thu, 17 Nov 2016 18:23:39 -0500 Subject: [PATCH] feat(serve): add --show-progress toggle to disable ProgressPlugin This patch adds a command line option that can disable the Webpack ProgressPlugin, keeping it enabled by default --- packages/angular-cli/commands/serve.ts | 8 ++++++++ packages/angular-cli/tasks/serve-webpack.ts | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/angular-cli/commands/serve.ts b/packages/angular-cli/commands/serve.ts index 4b19b651edb1..062ede9c7460 100644 --- a/packages/angular-cli/commands/serve.ts +++ b/packages/angular-cli/commands/serve.ts @@ -22,6 +22,7 @@ export interface ServeTaskOptions { liveReloadLiveCss?: boolean; target?: string; environment?: string; + showProgress: boolean; ssl?: boolean; sslKey?: string; sslCert?: string; @@ -78,6 +79,13 @@ const ServeCommand = Command.extend({ aliases: ['t', { 'dev': 'development' }, { 'prod': 'production' }] }, { name: 'environment', type: String, default: '', aliases: ['e'] }, + { + name: 'show-progress', + type: Boolean, + default: true, + description: 'Whether to show the Webpack build progress (default true)', + aliases: ['sp'] + }, { name: 'ssl', type: Boolean, default: false }, { name: 'ssl-key', type: String, default: 'ssl/server.key' }, { name: 'ssl-cert', type: String, default: 'ssl/server.crt' }, diff --git a/packages/angular-cli/tasks/serve-webpack.ts b/packages/angular-cli/tasks/serve-webpack.ts index 5f8a98980966..725bd9b4d56f 100644 --- a/packages/angular-cli/tasks/serve-webpack.ts +++ b/packages/angular-cli/tasks/serve-webpack.ts @@ -37,10 +37,12 @@ export default Task.extend({ ); webpackCompiler = webpack(config); - webpackCompiler.apply(new ProgressPlugin({ - profile: true, - colors: true - })); + if (commandOptions.showProgress) { + webpackCompiler.apply(new ProgressPlugin({ + profile: false, + colors: false + })); + } let proxyConfig = {}; if (commandOptions.proxyConfig) {