feat(webpack): add --env.stats to disable printing stats

primarily used internally by preview-cli
This commit is contained in:
Igor Randjelovic
2022-07-10 11:36:47 +02:00
committed by Nathan Walker
parent eedc9c9eb1
commit e80ec07873
3 changed files with 19 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ export class WatchStatePlugin {
callback();
if (isWatchMode) {
console.log(messages.changeDetected);
env.stats && console.log(messages.changeDetected);
if (env.verbose) {
if (compiler.modifiedFiles) {
@@ -44,9 +44,10 @@ export class WatchStatePlugin {
compiler.hooks.afterEmit.tapAsync(id, function (compilation, callback) {
callback();
console.log(
isWatchMode ? messages.startWatching : messages.compilationComplete
);
env.stats &&
console.log(
isWatchMode ? messages.startWatching : messages.compilationComplete
);
// Do not notify the CLI if the compilation failed
const stats = compilation.getStats();