diff --git a/lib/compile.js b/lib/compile.js index 64da03dd0..cc0a56483 100644 --- a/lib/compile.js +++ b/lib/compile.js @@ -29,7 +29,10 @@ module.exports = { }; _.forEach(stats.stats, compileStats => { - this.serverless.cli.consoleLog(compileStats.toString(consoleStats)); + const statsOutput = compileStats.toString(consoleStats); + if (statsOutput) { + this.serverless.cli.consoleLog(statsOutput); + } if (compileStats.compilation.errors.length) { throw new Error('Webpack compilation error, see above'); diff --git a/lib/wpwatch.js b/lib/wpwatch.js index 0ffb5c6cb..2bcd0991c 100644 --- a/lib/wpwatch.js +++ b/lib/wpwatch.js @@ -97,7 +97,10 @@ module.exports = { if (stats) { lastHash = stats.hash; - this.serverless.cli.consoleLog(stats.toString(consoleStats)); + const statsOutput = stats.toString(consoleStats); + if (statsOutput) { + this.serverless.cli.consoleLog(stats.toString(consoleStats)); + } } if (firstRun) {