webpack: Add the option to output the bell character on error when watching

When I’m starting webpack like this

webpack --watch

it’s difficult to see when a compilation error happens after I save a file.

It would be very helpful to have a configuration option to output the bell character everytime an error happens.

process.stdout.write('\x07');

The OSX Terminal.app will automatically show a little notification in the dock when the app is in the background or minimized and you can configure it to play sound, too (I think it’s off by default.)

image

The behavior depends on your terminal emulator, of course, but iTerm 2 also supports this.

Having this option would help spotting errors much earlier, because I often find myself having the terminal window in the background. Especially when developing on a laptop with only one screen.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

https://www.npmjs.com/package/webpack-notifier offers similar capabilities, but integrates with OSX notifications

@bebraw @rattrayalex Sorry for the late reply, but I have finally made a plugin out of this: https://www.npmjs.com/package/system-bell-webpack-plugin

Initially I had given up on it because of the bug that was causing the error handler to be called mulitple times, but that bug was gone when I checked today! So I decided to package it. Let me know if it works for you!