webpack-isomorphic-compiler-reporter
Beautiful reporting for webpack-isomorphic-compiler compilation events.
While webpack-sane-compiler-reporter works fine with this compiler, the output is incomplete. This reporter is specially designed to be used with this compiler.
Installation
$ npm install webpack-isomorphic-compiler-reporter --save-dev
Usage
const startReporting = require('webpack-isomorphic-compiler-reporter');
const { stop, options } = startReporting(compiler, {});
Available options:
Name | Description | Type | Default |
---|
stats | Display webpack stats after each compilation | boolean/string (true , false or 'once' ) | true |
humanErrors | Detects human errors related to webpack configuration mistakes (done only once) | boolean | true |
write | Function responsible for printing/outputting the generated report messages | function | Prints to stderr |
printStart | Function responsible for generating a message for when a compilation starts | function | |
printSuccess | Function responsible for generating a message when a compilation succeeds | function | |
printFailure | Function responsible for generating a message when a compilation fails | function | |
printStats | Function responsible for generating a message representing a WebpackStats instance | function | |
printError | Function responsible for generating a message of a Error instance | function | |
API
As shown in the usage section above, the result of adding reporting on a compiler is a function that, when invoked, stops listening to the compiler events, hence halting any further output.
Other exports
For convenience this package also exports the renderers used internally:
const reporter = require('webpack-isomorphic-compiler-reporter');
reporter(compiler, {
printError: (err) => `${reporter.renderers.renderError(err)}\n`,
});
Tests
$ npm test
$ npm test -- --watch
during development
License
MIT License