You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.2 KiB

4 years ago
  1. # webpack-notifier
  2. [![Build Status](https://img.shields.io/travis/Turbo87/webpack-notifier.svg)](https://travis-ci.org/Turbo87/webpack-notifier)
  3. [![npm Version](https://img.shields.io/npm/v/webpack-notifier.svg)](https://www.npmjs.com/package/webpack-notifier)
  4. This is a [webpack](http://webpack.github.io/) plugin that uses the
  5. [node-notifier](https://github.com/mikaelbr/node-notifier) package to
  6. display build status system notifications to the user.
  7. ![webpack-notifier screenshot](screenshot.png)
  8. > This is a fork of the
  9. [webpack-error-notification](https://github.com/vsolovyov/webpack-error-notification)
  10. plugin. It adds support for Windows and there is no need to manually install
  11. the `terminal-notifier` package on OS X anymore.
  12. The plugin will notify you about the first run (success/fail),
  13. all failed runs and the first successful run after recovering from
  14. a build failure. In other words: it will stay silent if everything
  15. is fine with your build.
  16. ## Installation
  17. Use `npm` to install this package:
  18. npm install --save-dev webpack-notifier
  19. Check the `node-notifier`
  20. [Requirements](https://github.com/mikaelbr/node-notifier#requirements)
  21. whether you need to install any additional tools for your OS.
  22. ## Usage
  23. In the `webpack.config.js` file:
  24. ```js
  25. var WebpackNotifierPlugin = require('webpack-notifier');
  26. var config = module.exports = {
  27. // ...
  28. plugins: [
  29. new WebpackNotifierPlugin(),
  30. ]
  31. },
  32. ```
  33. ## Configuration
  34. ### Title
  35. Title shown in the notification.
  36. ```js
  37. new WebpackNotifierPlugin({title: 'Webpack'});
  38. ```
  39. ### Content Image
  40. Image shown in the notification.
  41. ```js
  42. var path = require('path');
  43. new WebpackNotifierPlugin({contentImage: path.join(__dirname, 'logo.png')});
  44. ```
  45. ### Exclude Warnings
  46. If set to `true`, warnings will not cause a notification.
  47. ```js
  48. new WebpackNotifierPlugin({excludeWarnings: true});
  49. ```
  50. ### Always Notify
  51. Trigger a notification every time. Call it "noisy-mode".
  52. ```js
  53. new WebpackNotifierPlugin({alwaysNotify: true});
  54. ```
  55. ### Skip Notification on the First Build
  56. Do not notify on the first build. This allows you to receive notifications on subsequent incremental builds without being notified on the initial build.
  57. ```js
  58. new WebpackNotifierPlugin({skipFirstNotification: true});
  59. ```