Registry / devops / webpack-sane-compiler-notifier

webpack-sane-compiler-notifier

JSON →
library2.1.1jsnpmunverified

Library that sends OS-level notifications (e.g., native desktop notifications) about webpack compilation status when used with webpack-sane-compiler. Current stable version: 2.1.1. Released sporadically; last release 2020. Key differentiators: simple, zero-config API; integrates directly with webpack-sane-compiler's events; supports custom title, icon, and sound.

npm install webpack-sane-compiler-notifier
INSTALL
IMPORT
SIG · WEBPACK-SANE-COMPI
W
webpack-sane-compiler-notifier
devopsjavascriptv2.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

startNotifying
const startNotifying = require('webpack-sane-compiler-notifier'); const { stop, options } = startNotifying(compiler, {});
import startNotifying from 'webpack-sane-compiler-notifier';
CommonJS only; packages does not provide ESM exports.
stop
const startNotifying = require('webpack-sane-compiler-notifier'); const { stop } = startNotifying(compiler);
const { stop } = require('webpack-sane-compiler-notifier');
stop is returned from startNotifying, not a direct export.
options
const startNotifying = require('webpack-sane-compiler-notifier'); const { options } = startNotifying(compiler, { title: 'Build' });
const options = require('webpack-sane-compiler-notifier').options;
options is the merged configuration returned from startNotifying.

Shows how to set up OS notifications for webpack builds using webpack-sane-compiler.

const webpack = require('webpack'); const WebpackSaneCompiler = require('webpack-sane-compiler'); const startNotifying = require('webpack-sane-compiler-notifier'); const compiler = webpack({ /* webpack config */ }); const saneCompiler = new WebpackSaneCompiler(compiler); const { stop } = startNotifying(saneCompiler, { title: 'My App', sound: true }); saneCompiler.watch({}, (err, stats) => { if (err) console.error(err); else console.log('Build done'); }); // Later: stop();
Debug
Known issues
deprecatedPackage is in maintenance mode; no active development since 2020.
fix
Consider migrating to @webpack-cli/serve or webpack-dev-server for notifications.
affects: >=2.0.0
gotchastartNotifying expects a webpack-sane-compiler instance, not a raw webpack compiler.
fix
Wrap your webpack compiler with new WebpackSaneCompiler(compiler) before passing it.
affects: >=1.0.0
breakingv2.0.0 changed the return value from undefined to { stop, options }.
fix
Update calls to capture destructured { stop, options } from startNotifying.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: compiler.hooks is not a function
Passed a raw webpack compiler instead of a webpack-sane-compiler instance.
fix
Wrap compiler: const saneCompiler = new WebpackSaneCompiler(compiler); then pass saneCompiler to startNotifying.
Cannot find module 'webpack-sane-compiler'
Missing peer dependency webpack-sane-compiler.
fix
Run: npm install webpack-sane-compiler
TypeError: Cannot destructure property 'stop' of undefined
Using return value from v1 of the package which returned undefined.
fix
Upgrade to v2 and use: const { stop } = startNotifying(compiler);
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies
webpack-sane-compilerrequiredPeer dependency; the notifier listens to events from webpack-sane-compiler
Agent activity
45 hits · last 30 days
node
36
OpenAI (training)
1
Resources
webpack-sane-compiler-notifier — npm install webpack-sane-compiler-notifier · libregistry