Registry / devops / webpack-sane-compiler-reporter

webpack-sane-compiler-reporter

JSON →
library3.3.2jsnpmunverified

A reporter library for the webpack-sane-compiler that provides pretty, customizable console output for webpack compilation events (start, success, failure, invalidate, stats). Version 3.3.2 is the latest stable release. It is designed specifically for webpack-sane-compiler (peer dependency >=2.0.0 <4.0.0) and offers hooks to customize each message type, with defaults that print to stderr. Unlike generic webpack reporters, it integrates tightly with the sane compiler API, supporting features like stats display (true, false, 'once') and fine-grained event-level formatting.

npm install webpack-sane-compiler-reporter
INSTALL
IMPORT
SIG · WEBPACK-SANE-COMPI
W
webpack-sane-compiler-reporter
devopsjavascriptv3.3.2
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.

default
✓ import startReporting from 'webpack-sane-compiler-reporter'
✗ const { startReporting } = require('webpack-sane-compiler-reporter')
This package exports a single function as default. In CommonJS, use require('webpack-sane-compiler-reporter') and call it.
startReporting
✓ const startReporting = require('webpack-sane-compiler-reporter');
✗ import { startReporting } from 'webpack-sane-compiler-reporter'
CommonJS requires the whole module; ES import uses default import, not named.
startReporting (returned object)
✓ const { stop, options } = startReporting(compiler, {/* options */});
✗ const stop = startReporting(compiler, {}).stop
The function returns an object with 'stop' and 'options'. Destructure both at once.

Shows how to create a SaneCompiler instance, attach the reporter with custom options, and run a compilation.

import startReporting from 'webpack-sane-compiler-reporter'; import SaneCompiler from 'webpack-sane-compiler'; import webpack from 'webpack'; const config = { /* webpack config */ }; const compiler = new SaneCompiler(webpack(config)); const { stop, options } = startReporting(compiler, { stats: 'once' }); compiler.run((err, stats) => { if (err) console.error(err); // Reports are printed automatically stop(); });
Debug
Known issues
breakingv3.0.0 changed the API: the function now returns { stop, options } instead of just stop.
fix
Update code to destructure stop and options from the return value.
affects: >=3.0.0 <4.0.0
breakingv2.0.0 removed the 'verbose' option; use 'stats' option instead.
fix
Replace verbose: true with stats: 'once' or stats: true.
affects: >=2.0.0 <3.0.0
deprecatedThe 'printStart', 'printSuccess', etc. custom functions are deprecated in favor of a single 'printer' option? (Check docs).
fix
Refer to latest documentation; if not confirmed, use the object-style customization.
affects: >=3.3.0
gotchaThe reporter prints to stderr by default. To capture output, provide a custom 'write' function.
fix
Specify write: (msg) => process.stdout.write(msg) to redirect to stdout.
affects: *
Errors
Common errors & fixes
TypeError: startReporting is not a function
Using ES import incorrectly: import { startReporting } from '...' instead of default import.
fix
Use import startReporting from 'webpack-sane-compiler-reporter' or const startReporting = require('...')
Cannot find module 'webpack-sane-compiler'
Missing peer dependency 'webpack-sane-compiler'.
fix
Install the peer dependency: npm install webpack-sane-compiler
options.stats should be a boolean or 'once'
Provided an invalid value for stats option (e.g., 'verbose').
fix
Set stats to true, false, or 'once'.
Upgrade
Version history
3.3.2latest on npm
Audit
Dependencies
webpack-sane-compilerrequiredPeer dependency: provides the compiler instance that emits events to report on.
Agent activity
8 hits · last 30 days
node
8
Resources
webpack-sane-compiler-reporter — npm install webpack-sane-compiler-reporter · libregistry