Registry / devops / webpack-notifier

webpack-notifier

JSON →
library1.15.0jsnpmunverified

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).

npm install webpack-notifier
INSTALL
IMPORT
SIG · WEBPACK-NOTIFIER
W
webpack-notifier
devopsjavascriptv1.15.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WebpackNotifierPlugin
import WebpackNotifierPlugin from 'webpack-notifier'; // or for CommonJS const WebpackNotifierPlugin = require('webpack-notifier');
import { WebpackNotifierPlugin } from 'webpack-notifier';
The plugin is exported as a default export in CommonJS and ESM contexts.
Configuration options
new WebpackNotifierPlugin({ title: 'My Build', excludeWarnings: true });
new WebpackNotifierPlugin({ 'title': 'My Build' });
Configuration options are passed as a plain object to the constructor.
WebpackNotifierPlugin
import type WebpackNotifierPlugin from 'webpack-notifier';
When using TypeScript, import the type if you only need type declarations without runtime import.

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 };
Debug
Known issues
gotchawebpack-notifier relies on the `node-notifier` package, which itself has platform-specific requirements. Users might need to install additional system tools (e.g., `growl` on macOS prior to Big Sur, or `snoretoast` on Windows for some versions) for notifications to function correctly.
fix
Check the `node-notifier` documentation for your operating system's specific requirements and install any necessary dependencies manually: `https://github.com/mikaelbr/node-notifier#requirements`
affects: >=1.0.0
gotchaWhen migrating from `webpack-error-notification`, be aware that `webpack-notifier` provides improved Windows support and removes the need for `terminal-notifier` on OS X, simplifying setup but changing the underlying notification mechanism.
fix
Ensure `terminal-notifier` is uninstalled if it was previously manually installed for older notification plugins, as `webpack-notifier` handles this automatically via `node-notifier`.
affects: >=1.0.0
gotchaPrior to v1.3.0, error and warning messages in notifications did not have specific prefixes. Since v1.3.0, messages are prefixed for clearer identification.
fix
Update to `webpack-notifier@1.3.0` or higher to benefit from clearer, prefixed error and warning messages in your system notifications.
affects: <1.3.0
gotchaIf notifications are not appearing, ensure that your operating system's notification settings are configured to allow notifications from the application running webpack (e.g., your terminal or IDE).
fix
Check system preferences/settings for notifications. On macOS, look under 'Notifications & Focus'. On Windows, 'System > Notifications & actions'. Ensure notifications are enabled for the process running webpack.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: WebpackNotifierPlugin is not a constructor
Attempting to import WebpackNotifierPlugin as a named export when it is a default export.
fix
Use `const WebpackNotifierPlugin = require('webpack-notifier');` for CommonJS or `import WebpackNotifierPlugin from 'webpack-notifier';` for ESM.
Error: stdout maxBuffer exceeded
This error often originates from `node-notifier` when the message content (especially with large stack traces in errors) is too long for the underlying notification system's stdout buffer.
fix
Consider using the `onlyOnError: true` and `excludeWarnings: true` options to reduce notification frequency, or implement a custom `message` function in the plugin configuration to truncate lengthy error messages before they are passed to the notifier.
Notifications are not showing up on [OS Name]
The underlying `node-notifier` package might require specific system tools that are not installed on the user's OS, or system notification settings are preventing display.
fix
Refer to the `node-notifier` 'Requirements' section on its GitHub page (`https://github.com/mikaelbr/node-notifier#requirements`) for your specific OS and install any missing dependencies. Also, check your OS notification settings for the terminal or IDE running webpack.
Upgrade
Version history
1.15.0latest on npm
Audit
Dependencies
node-notifierrequiredCore dependency for displaying system notifications. Users may need to install additional OS-specific tools depending on node-notifier's requirements.
webpackrequiredPeer dependency as it's a webpack plugin.
@types/webpackoptionalTypeScript type definitions for webpack, a peer dependency for type safety.
Agent activity
20 hits · last 30 days
node
20
Resources