Skip to content

Option to turn off progress logging #2815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/angular-cli/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface BuildOptions {
supressSizes: boolean;
baseHref?: string;
aot?: boolean;
progress?: boolean;
}

const BuildCommand = Command.extend({
Expand All @@ -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) {
Expand Down
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
11 changes: 7 additions & 4 deletions packages/angular-cli/tasks/build-webpack-watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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) => {
Expand Down
10 changes: 6 additions & 4 deletions packages/angular-cli/tasks/build-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ export default <any>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) => {
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