Skip to content

Commit c0d9433

Browse files
committed
feat(build): add option to turn of progress logs
Now use `ng build --no-progress` to disable the progress information. Closes angular#2012
1 parent 50c0f17 commit c0d9433

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

packages/angular-cli/commands/build.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface BuildOptions {
1111
supressSizes: boolean;
1212
baseHref?: string;
1313
aot?: boolean;
14+
progress?: boolean;
1415
}
1516

1617
const BuildCommand = Command.extend({
@@ -31,7 +32,8 @@ const BuildCommand = Command.extend({
3132
{ name: 'watcher', type: String },
3233
{ name: 'suppress-sizes', type: Boolean, default: false },
3334
{ name: 'base-href', type: String, default: null, aliases: ['bh'] },
34-
{ name: 'aot', type: Boolean, default: false }
35+
{ name: 'aot', type: Boolean, default: false },
36+
{ name: 'progress', type: Boolean, default: true }
3537
],
3638

3739
run: function (commandOptions: BuildOptions) {

packages/angular-cli/tasks/build-webpack-watch.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as rimraf from 'rimraf';
22
import * as path from 'path';
33
const Task = require('ember-cli/lib/models/task');
44
import * as webpack from 'webpack';
5-
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
65
import { NgCliWebpackConfig } from '../models/webpack-config';
76
import { webpackOutputOptions } from '../models/';
87
import { BuildOptions } from '../commands/build';
@@ -28,9 +27,13 @@ export default Task.extend({
2827
).config;
2928
const webpackCompiler: any = webpack(config);
3029

31-
webpackCompiler.apply(new ProgressPlugin({
32-
profile: true
33-
}));
30+
if (runTaskOptions.progress) {
31+
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
32+
33+
webpackCompiler.apply(new ProgressPlugin({
34+
profile: true
35+
}));
36+
}
3437

3538
return new Promise((resolve, reject) => {
3639
webpackCompiler.watch({}, (err: any, stats: any) => {

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ export default <any>Task.extend({
3131

3232
const webpackCompiler: any = webpack(config);
3333

34-
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
34+
if (runTaskOptions.progress) {
35+
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
3536

36-
webpackCompiler.apply(new ProgressPlugin({
37-
profile: true
38-
}));
37+
webpackCompiler.apply(new ProgressPlugin({
38+
profile: true
39+
}));
40+
}
3941

4042
return new Promise((resolve, reject) => {
4143
webpackCompiler.run((err: any, stats: any) => {

0 commit comments

Comments
 (0)