Skip to content

Commit

Permalink
docs: update example for webpack 4.x usage (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorKolb authored and lukeed committed Nov 22, 2018
1 parent ca942c8 commit 5db7fdd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ const formatMessages = require('webpack-format-messages');

const compiler = webpack(/* config */);

compiler.plugin('invalid', () => console.log('Compiling...'));
compiler.hooks.invalid.tap('invalid', function() {
console.log('Compiling...');
});

compiler.plugin('done', stats => {
compiler.hooks.done.tap('done', (stats) => {
const messages = formatMessages(stats);

if (!messages.errors.length && !messages.warnings.length) {
Expand All @@ -51,7 +53,7 @@ compiler.plugin('done', stats => {
if (messages.warnings.length) {
console.log('Compiled with warnings.');
messages.warnings.forEach(w => console.log(w));
}
}
});
```

Expand Down

0 comments on commit 5db7fdd

Please sign in to comment.