Skip to content

Commit

Permalink
feat(serve): add option to turn of progress logs
Browse files Browse the repository at this point in the history
Fix #2012

Use ng serve --no-progress to disable the progress bar.
  • Loading branch information
victornoel committed Oct 21, 2016
1 parent 7775cb9 commit 8e682d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/angular-cli/commands/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface ServeTaskOptions {
sslCert?: string;
aot?: boolean;
open?: boolean;
progress?: boolean;
}

const ServeCommand = Command.extend({
Expand Down Expand Up @@ -88,6 +89,7 @@ const ServeCommand = Command.extend({
aliases: ['o'],
description: 'Opens the url in default browser',
},
{ name: 'progress', type: Boolean, default: true },
],

run: function(commandOptions: ServeTaskOptions) {
Expand Down
13 changes: 8 additions & 5 deletions packages/angular-cli/tasks/serve-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const SilentError = require('silent-error');
const Task = require('ember-cli/lib/models/task');
import * as webpack from 'webpack';
const WebpackDevServer = require('webpack-dev-server');
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
import { webpackDevServerOutputOptions } from '../models/';
import { NgCliWebpackConfig } from '../models/webpack-config';
import { ServeTaskOptions } from '../commands/serve';
Expand Down Expand Up @@ -36,10 +35,14 @@ export default Task.extend({
);
webpackCompiler = webpack(config);

webpackCompiler.apply(new ProgressPlugin({
profile: true,
colors: true
}));
if (commandOptions.progress) {
const ProgressPlugin = require('webpack/lib/ProgressPlugin');

webpackCompiler.apply(new ProgressPlugin({
profile: true,
colors: true
}));
}

let proxyConfig = {};
if (commandOptions.proxyConfig) {
Expand Down

0 comments on commit 8e682d5

Please sign in to comment.