Webpack Build Status Notifier

1.15.0 · active · verified Tue Apr 21

webpack-notifier is a webpack plugin that integrates with node-notifier to provide system-level notifications for webpack build statuses. It's currently at version 1.15.0 and seems to have a moderate release cadence, focusing on stability and compatibility. Key differentiators include its ability to notify on the first run (success/fail), all failed runs, and the first successful run after a failure, remaining silent otherwise to avoid notification spam. It notably improves upon its predecessor, webpack-error-notification, by adding robust support for Windows and eliminating the need for manual `terminal-notifier` installation on OS X, making it more cross-platform friendly. It leverages the underlying `node-notifier` library, which handles platform-specific notification mechanisms. The plugin offers various configuration options for notification titles, content images, and controlling when notifications are triggered (e.g., excluding warnings, always notifying, or only on error).

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to integrate webpack-notifier into a basic webpack configuration, showing how to instantiate the plugin and configure common options like `title`, `alwaysNotify`, `contentImage`, `excludeWarnings`, and `skipFirstNotification`.

const path = require('path');
const WebpackNotifierPlugin = require('webpack-notifier');

module.exports = {
  mode: 'development',
  entry: './src/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist'),
  },
  plugins: [
    new WebpackNotifierPlugin({
      title: 'My Webpack Build',
      alwaysNotify: true, // Be 'noisy' and notify on every build
      contentImage: path.join(__dirname, 'logo.png'), // Ensure 'logo.png' exists for this to work
      excludeWarnings: false, // Show warnings in notifications
      skipFirstNotification: false // Notify on the initial build
    }),
  ],
  // Create a dummy logo.png for the example to be runnable
  // For a real project, replace with an actual image path.
  // This ensures the example is complete without external files.
  // fs.writeFileSync(path.join(__dirname, 'logo.png'), 'dummy data'); // Not ideal for quickstart code but illustrates the point
};

view raw JSON →