diff --git a/packages/angular-cli/commands/build.ts b/packages/angular-cli/commands/build.ts index 744b405fe567..ba1d01770414 100644 --- a/packages/angular-cli/commands/build.ts +++ b/packages/angular-cli/commands/build.ts @@ -11,6 +11,7 @@ export interface BuildOptions { supressSizes: boolean; baseHref?: string; aot?: boolean; + progress?: boolean; } const BuildCommand = Command.extend({ @@ -31,7 +32,8 @@ const BuildCommand = Command.extend({ { name: 'watcher', type: String }, { name: 'suppress-sizes', type: Boolean, default: false }, { name: 'base-href', type: String, default: null, aliases: ['bh'] }, - { name: 'aot', type: Boolean, default: false } + { name: 'aot', type: Boolean, default: false }, + { name: 'progress', type: Boolean, default: true } ], run: function (commandOptions: BuildOptions) { diff --git a/packages/angular-cli/commands/serve.ts b/packages/angular-cli/commands/serve.ts index 7c16c49993b8..5151150b7059 100644 --- a/packages/angular-cli/commands/serve.ts +++ b/packages/angular-cli/commands/serve.ts @@ -27,6 +27,7 @@ export interface ServeTaskOptions { sslCert?: string; aot?: boolean; open?: boolean; + progress?: boolean; } const ServeCommand = Command.extend({ @@ -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) { diff --git a/packages/angular-cli/tasks/build-webpack-watch.ts b/packages/angular-cli/tasks/build-webpack-watch.ts index 700c977298e4..97788d423274 100644 --- a/packages/angular-cli/tasks/build-webpack-watch.ts +++ b/packages/angular-cli/tasks/build-webpack-watch.ts @@ -2,7 +2,6 @@ import * as rimraf from 'rimraf'; import * as path from 'path'; const Task = require('ember-cli/lib/models/task'); import * as webpack from 'webpack'; -const ProgressPlugin = require('webpack/lib/ProgressPlugin'); import { NgCliWebpackConfig } from '../models/webpack-config'; import { webpackOutputOptions } from '../models/'; import { BuildOptions } from '../commands/build'; @@ -28,9 +27,13 @@ export default Task.extend({ ).config; const webpackCompiler: any = webpack(config); - webpackCompiler.apply(new ProgressPlugin({ - profile: true - })); + if (runTaskOptions.progress) { + const ProgressPlugin = require('webpack/lib/ProgressPlugin'); + + webpackCompiler.apply(new ProgressPlugin({ + profile: true + })); + } return new Promise((resolve, reject) => { webpackCompiler.watch({}, (err: any, stats: any) => { diff --git a/packages/angular-cli/tasks/build-webpack.ts b/packages/angular-cli/tasks/build-webpack.ts index 80fc0b9e62a5..f21f1ce757dc 100644 --- a/packages/angular-cli/tasks/build-webpack.ts +++ b/packages/angular-cli/tasks/build-webpack.ts @@ -31,11 +31,13 @@ export default Task.extend({ const webpackCompiler: any = webpack(config); - const ProgressPlugin = require('webpack/lib/ProgressPlugin'); + if (runTaskOptions.progress) { + const ProgressPlugin = require('webpack/lib/ProgressPlugin'); - webpackCompiler.apply(new ProgressPlugin({ - profile: true - })); + webpackCompiler.apply(new ProgressPlugin({ + profile: true + })); + } return new Promise((resolve, reject) => { webpackCompiler.run((err: any, stats: any) => { diff --git a/packages/angular-cli/tasks/serve-webpack.ts b/packages/angular-cli/tasks/serve-webpack.ts index 9c2e0a6229ad..ec0c38764263 100644 --- a/packages/angular-cli/tasks/serve-webpack.ts +++ b/packages/angular-cli/tasks/serve-webpack.ts @@ -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'; @@ -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) {