1. webpack-notifier
webpack + node-notifier = build status system notifications
webpack-notifier
Package: webpack-notifier
Created by: Turbo87
Last modified: Sun, 10 Sep 2023 02:38:06 GMT
Version: 1.15.0
License: ISC
Downloads: 2,154,588
Repository: https://github.com/Turbo87/webpack-notifier

Install

npm install webpack-notifier
yarn add webpack-notifier

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

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});

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code