From fa6db817b058bd3c193b38dc1af0aa4ed4cdf8b9 Mon Sep 17 00:00:00 2001 From: Sergii Kovalev Date: Wed, 7 Apr 2021 21:22:35 +0300 Subject: [PATCH] Fix: Empty lines while stats: 'errors-only' --- lib/compile.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/compile.js b/lib/compile.js index cdb9b6d61..faa1b9a6c 100644 --- a/lib/compile.js +++ b/lib/compile.js @@ -18,7 +18,12 @@ function ensureArray(obj) { } function getStatsLogger(statsConfig, consoleLog) { - return stats => consoleLog(stats.toString(statsConfig || defaultStatsConfig)); + return stats => { + const statsOutput = stats.toString(statsConfig || defaultStatsConfig); + if (statsOutput) { + consoleLog(statsOutput); + } + }; } function webpackCompile(config, logStats) {