For anyone working iteratively using webpack --watch
: First do npm install node-notifier --save-dev
and then put this into webpack.config.js
:
const notifier = require('node-notifier');
...
plugins: [
function() {
this.plugin("done", function(stats) {
if (stats.hasErrors()) {
notifier.notify('Error');
} else {
notifier.notify('Ok!');
}
});
}
]
...
Now a notifier will appear each time the build passes (or fails) so you don't need to look at the terminal each time. Nice for keeping the flow!