Registry / devops / webpack-logging-plugin

webpack-logging-plugin

JSON →
library0.1.2jsnpmunverified

A webpack plugin that provides customizable progress logging and error/warning formatting during compilation. Version 0.1.2 is the latest stable release, with no recent updates (appears to be in maintenance mode). It supports webpack ^2.2.0 and Node >=4.0.0. Key differentiators include the ability to customize error and stats formatting via callbacks, and integration with multi-compiler setups for universal applications. Alternatives include the built-in webpack progress plugin or progress-bar-webpack-plugin, but this plugin offers more control over output.

npm install webpack-logging-plugin
INSTALL
IMPORT
SIG · WEBPACK-LOGGING-PL
W
webpack-logging-plugin
devopsjavascriptv0.1.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.

WebpackLoggingPlugin
const WebpackLoggingPlugin = require('webpack-logging-plugin');
import WebpackLoggingPlugin from 'webpack-logging-plugin';
The package uses CommonJS exports. ESM import may not work without a module bundler transformation.

Shows how to add the plugin to a webpack config with custom formatting callbacks, using react-dev-utils as an example.

const WebpackLoggingPlugin = require('webpack-logging-plugin'); // Example: custom logging with react-dev-utils formatting const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages'); const config = { entry: './src/index.js', output: { filename: 'bundle.js', path: __dirname + '/dist' }, plugins: [ new WebpackLoggingPlugin({ formatError: (err) => err, formatStats: (stats) => formatWebpackMessages(stats.toJson({}, true)), successCallback: () => console.log('Build succeeded!'), }), ], }; module.exports = config;
Debug
Known issues
gotchaThe plugin does not provide default formatting; you must supply formatError and formatStats functions, otherwise errors/stats will pass through unchanged.
fix
Provide custom formatters or ensure the default behavior is acceptable.
affects: >=0.1.0
gotchaWhen using with multi-compiler, the plugin must be applied to the multiCompiler object, not individual compilers.
fix
Use multiCompiler.apply(new WebpackLoggingPlugin({...})) instead of applying per compiler.
affects: >=0.1.0
gotchaThe plugin wraps webpack's progress hooks; using other progress-modifying plugins simultaneously may cause conflicts.
fix
Avoid combining with other progress plugins, or test thoroughly.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: Cannot read property 'apply' of undefined
Plugin is applied to a multiCompiler that hasn't been created or is null.
fix
Ensure multiCompiler is the result of webpack(configs), not undefined.
Error: No formatStats function provided; stats will be output as is.
Missing formatStats option in configuration.
fix
Provide a formatStats function: formatStats: (stats) => stats.toJson()
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
webpackrequiredPeer dependency; plugin requires webpack to function.
Agent activity
4 hits · last 30 days
node
4
Resources
webpack-logging-plugin — npm install webpack-logging-plugin · libregistry