Skip to content

Commit

Permalink
Fix usage example to match [email protected] API
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Sep 30, 2016
1 parent 90e3cc1 commit a8d29c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react-dev-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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!');
}
Expand Down

0 comments on commit a8d29c8

Please sign in to comment.