Skip to content

Commit

Permalink
Merge pull request #500 from Enase/empty-lines
Browse files Browse the repository at this point in the history
Fix: Empty lines while stats: 'errors-only'
  • Loading branch information
HyperBrain authored May 20, 2019
2 parents fc2cffd + b08b758 commit f6fba80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
5 changes: 4 additions & 1 deletion lib/wpwatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f6fba80

Please sign in to comment.