Registry /
devops / webpack-sane-compiler-notifier
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();
Errors
Common errors & fixes
TypeError: compiler.hooks is not a function
Passed a raw webpack compiler instead of a webpack-sane-compiler instance.
fixWrap compiler: const saneCompiler = new WebpackSaneCompiler(compiler); then pass saneCompiler to startNotifying.
Cannot find module 'webpack-sane-compiler'
Missing peer dependency webpack-sane-compiler.
fixRun: npm install webpack-sane-compiler
TypeError: Cannot destructure property 'stop' of undefined
Using return value from v1 of the package which returned undefined.
fixUpgrade to v2 and use: const { stop } = startNotifying(compiler); Audit
Dependencies
webpack-sane-compilerrequiredPeer dependency; the notifier listens to events from webpack-sane-compiler