From fb600752bf8ac2fa539645d94304c56c27b99dc2 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Mon, 7 Dec 2020 18:01:05 +0300 Subject: [PATCH] fix: reduce spammy logs --- packages/webpack-cli/lib/plugins/CLIPlugin.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/webpack-cli/lib/plugins/CLIPlugin.js b/packages/webpack-cli/lib/plugins/CLIPlugin.js index a57a1d17846..643088643e5 100644 --- a/packages/webpack-cli/lib/plugins/CLIPlugin.js +++ b/packages/webpack-cli/lib/plugins/CLIPlugin.js @@ -42,10 +42,10 @@ class CLIPlugin { setupHelpfulOutput(compiler) { const pluginName = 'webpack-cli'; - const getCompilationName = (compilation) => (compilation.name ? ` '${compilation.name}'` : ''); + const getCompilationName = () => (compiler.name ? ` '${compiler.name}'` : ''); - compiler.hooks.run.tap(pluginName, (compiler) => { - this.logger.info(`Compilation${getCompilationName(compiler)} starting...`); + compiler.hooks.run.tap(pluginName, () => { + this.logger.log(`Compilation${getCompilationName()} starting...`); }); compiler.hooks.watchRun.tap(pluginName, (compiler) => { @@ -55,22 +55,22 @@ class CLIPlugin { this.logger.warn('You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.'); } - this.logger.info(`Compilation${getCompilationName(compiler)} starting...`); + this.logger.log(`Compilation${getCompilationName()} starting...`); }); compiler.hooks.invalid.tap(pluginName, (filename, changeTime) => { const date = new Date(changeTime * 1000); - this.logger.info(`File '${filename}' was modified`); + this.logger.log(`File '${filename}' was modified`); this.logger.log(`Changed time is ${date} (timestamp is ${changeTime})`); }); - (compiler.webpack ? compiler.hooks.afterDone : compiler.hooks.done).tap(pluginName, (stats) => { - this.logger.info(`Compilation${getCompilationName(stats.compilation)} finished`); + (compiler.webpack ? compiler.hooks.afterDone : compiler.hooks.done).tap(pluginName, () => { + this.logger.log(`Compilation${getCompilationName()} finished`); process.nextTick(() => { if (compiler.watchMode) { - this.logger.info(`Compiler${getCompilationName(stats.compilation)} is watching files for updates...`); + this.logger.log(`Compiler${getCompilationName()} is watching files for updates...`); } }); });