Skip to content

Instantly share code, notes, and snippets.

@worldsayshi
Last active March 25, 2016 06:59
Show Gist options
  • Save worldsayshi/9382539032657863643f to your computer and use it in GitHub Desktop.
Save worldsayshi/9382539032657863643f to your computer and use it in GitHub Desktop.

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment