Commit 3f6937c9 authored by Jimmy Miller's avatar Jimmy Miller Committed by Dan Abramov
Browse files

Change console.log for errors and warnings (#1375)

Array.forEach is passed the following parameters:

currentValue
    The current element being processed in the array.
index
    The index of the current element being processed in the array.
array
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach

console.log takes multiple arguments. We only want to print the first one, the actually message.
parent d29fb006
Showing with 2 additions and 2 deletions
+2 -2
......@@ -133,12 +133,12 @@ compiler.plugin('done', function(stats) {
}
if (messages.errors.length) {
console.log('Failed to compile.');
messages.errors.forEach(console.log);
messages.errors.forEach(e => console.log(e));
return;
}
if (messages.warnings.length) {
console.log('Compiled with warnings.');
messages.warnings.forEach(console.log);
messages.warnings.forEach(w => console.log(w));
}
});
```
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment