Skip to content

Commit 8a16e53

Browse files
committed
feat(serve): add option to turn of progress logs
Now use `ng serve --no-progress` to disable the progress bar. Closes angular#2012
1 parent c0d9433 commit 8a16e53

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

packages/angular-cli/commands/serve.ts

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface ServeTaskOptions {
2727
sslCert?: string;
2828
aot?: boolean;
2929
open?: boolean;
30+
progress?: boolean;
3031
}
3132

3233
const ServeCommand = Command.extend({
@@ -88,6 +89,7 @@ const ServeCommand = Command.extend({
8889
aliases: ['o'],
8990
description: 'Opens the url in default browser',
9091
},
92+
{ name: 'progress', type: Boolean, default: true },
9193
],
9294

9395
run: function(commandOptions: ServeTaskOptions) {

packages/angular-cli/tasks/serve-webpack.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const SilentError = require('silent-error');
55
const Task = require('ember-cli/lib/models/task');
66
import * as webpack from 'webpack';
77
const WebpackDevServer = require('webpack-dev-server');
8-
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
98
import { webpackDevServerOutputOptions } from '../models/';
109
import { NgCliWebpackConfig } from '../models/webpack-config';
1110
import { ServeTaskOptions } from '../commands/serve';
@@ -36,10 +35,14 @@ export default Task.extend({
3635
);
3736
webpackCompiler = webpack(config);
3837

39-
webpackCompiler.apply(new ProgressPlugin({
40-
profile: true,
41-
colors: true
42-
}));
38+
if (commandOptions.progress) {
39+
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
40+
41+
webpackCompiler.apply(new ProgressPlugin({
42+
profile: true,
43+
colors: true
44+
}));
45+
}
4346

4447
let proxyConfig = {};
4548
if (commandOptions.proxyConfig) {

0 commit comments

Comments
 (0)