Turbo87/webpack-notifier


webpack node-notifier = build status system notifications

License: ISC

Language: TypeScript


webpack-notifier

npm Version GitHub Workflow Status Coverage Status Code Style
npm npm bundle size

This is a webpack plugin that uses the node-notifier package to display build status system notifications to the user.

webpack-notifier screenshot

This is a fork of the webpack-error-notification plugin. It adds support for Windows and there is no need to manually install the terminal-notifier package on OS X anymore.

The plugin will notify you about the first run (success/fail), all failed runs and the first successful run after recovering from a build failure. In other words: it will stay silent if everything is fine with your build.

Installation

Use npm to install this package:

npm install --save-dev webpack-notifier

Check the node-notifier Requirements whether you need to install any additional tools for your OS.

Usage

In the webpack.config.js file:

var WebpackNotifierPlugin = require('webpack-notifier');

var config = module.exports = {
  // ...

  plugins: [
    new WebpackNotifierPlugin(),
  ]
}

Configuration

All node-notifier options

You can use any node-notifier options (depending on your OS) Except for options generated by the plugin itself:

  • title - it can be not only a string, but also a function
  • message - generated based on the value of other options
  • contentImage - it can be an object with images for different statuses
  • icon - matches with contentImage

Title

Title shown in the notification.

new WebpackNotifierPlugin({title: 'Webpack'});
new WebpackNotifierPlugin({title: function (params) {
  return `Build status is ${params.status} with message ${params.message}`;
}});

Emojis in message text

Show status emoji icon before the message.

new WebpackNotifierPlugin({emoji: true});

Content Image

Image shown in the notification. Can be a path string or object with paths.

String path:

var path = require('path');

new WebpackNotifierPlugin({contentImage: path.join(__dirname, 'logo.png')});

Object string path:

var path = require('path');

const statusesPaths = {
  success: path.join(__dirname, 'success.png'),
  warning: path.join(__dirname, 'warning.png'),
  error: path.join(__dirname, 'error.png')
}

new WebpackNotifierPlugin({contentImage: statusesPaths});

Exclude Warnings

If set to true, warnings will not cause a notification.

new WebpackNotifierPlugin({excludeWarnings: true});

Always Notify

Trigger a notification every time. Call it "noisy-mode".

new WebpackNotifierPlugin({alwaysNotify: true});

Notify on error

Trigger a notification only on error.

new WebpackNotifierPlugin({onlyOnError: true});

Skip Notification on the First Build

Do not notify on the first build. This allows you to receive notifications on subsequent incremental builds without being notified on the initial build.

new WebpackNotifierPlugin({skipFirstNotification: true});

Project Statistics

Sourcerank 14
Repository Size 623 KB
Stars 306
Forks 41
Watchers 7
Open issues 4
Dependencies 28
Contributors 23
Tags 27
Created
Last updated
Last pushed

Top Contributors See all

Gvozd Tobias Bieniek Vsevolod Solovyov John Reilly opensrcken Monstery Martijn Russchen Gerkin Igor «InoY» Zviagintsev ed320 Ryan Koval pavlin99th Rizki Ardian Joern Buchwald Tomas Junnonen Mikael Brevik Petr Bela Alexander Eric Lovett Carl Sverre

Packages Referencing this Repo

webpack-notifier
webpack node-notifier = build status system notifications
Latest release 1.15.0 - Updated - 306 stars
es-webpack-notifier
webpack node-notifier = build status system notifications, Add support for Multi-compiler mode
Latest release 1.7.0 - Updated - 306 stars
webpack-notifier-opensrcken
webpack node-notifier = build status system notifications
Latest release 1.3.2-opensrcken - Updated - 306 stars

Recent Tags See all

v1.15.0 December 19, 2021
v1.14.1 October 13, 2021
v1.14.0 October 03, 2021
v1.13.0 February 02, 2021
v1.12.0 December 07, 2020
v1.11.1 December 06, 2020
v1.11.0 November 29, 2020
v1.10.1 November 15, 2020
v1.10.0 November 15, 2020
v1.9.1 November 15, 2020
v1.9.0 November 15, 2020
v1.8.0 June 27, 2019
v1.7.0 October 10, 2018
v1.6.0 March 08, 2018
v1.5.1 January 20, 2018

Interesting Forks See all

inoyakaigor/webpack-notifier-2
webpack node-notifier = build status system notifications
JavaScript - ISC - Last pushed - 2 stars

Something wrong with this page? Make a suggestion

Last synced: 2024-07-31 23:20:21 UTC

Login to resync this repository