Commit a8d29c8c authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Fix usage example to match react-dev-utils@0.2.x API

parent 90e3cc1f
No related merge requests found
Showing with 3 additions and 2 deletions
+3 -2
......@@ -110,7 +110,7 @@ clearConsole();
console.log('Just cleared the screen!');
```
#### `formatWebpackMessages(stats: WebpackStats): {errors: Array<string>, warnings: Array<string>}`
#### `formatWebpackMessages({errors: Array<string>, warnings: Array<string>}): {errors: Array<string>, warnings: Array<string>}`
Extracts and prettifies warning and error messages from webpack [stats](https://github.com/webpack/docs/wiki/node.js-api#stats) object.
......@@ -125,7 +125,8 @@ compiler.plugin('invalid', function() {
});
compiler.plugin('done', function(stats) {
var messages = formatWebpackMessages(stats);
var rawMessages = stats.toJson({}, true);
var messages = formatWebpackMessages(rawMessages);
if (!messages.errors.length && !messages.warnings.length) {
console.log('Compiled successfully!');
}
......
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