webpack-info-plugin
raw JSON → 0.1.0 verified Sat Apr 25 auth: no javascript
A simple webpack plugin that displays build status and formatted stats output during development, similar to webpack-dev-middleware. Version 0.1.0 is the initial and only release. Provides configuration for stats display and state notifications (valid/invalid). Minimal dependencies (only webpack peer dependency). Differentiator: lightweight, configuration-focused, no extra middleware required.
Common errors
error TypeError: WebpackInfoPlugin is not a constructor ↓
cause Importing incorrectly or not using 'new'.
fix
Use const WebpackInfoPlugin = require('webpack-info-plugin'); new WebpackInfoPlugin(options);
error Error: Options for verbosity must be webpack stats options ↓
cause Passing an array or string instead of object for stats.
fix
Provide an object with valid stats keys, e.g., { colors: true }.
error Module not found: Error: Can't resolve 'webpack-info-plugin' ↓
cause Package not installed or import path wrong.
fix
Run npm install webpack-info-plugin --save-dev and ensure correct require path.
Warnings
gotcha Options 'stats' expects webpack stats toString options; 'colors' not 'color'. ↓
fix Use correct option key as shown in documentation.
gotcha Plugin constructs with 'new' keyword; do not call as function. ↓
fix Use new WebpackInfoPlugin(options).
deprecated This package has one release and is no longer maintained; consider using webpack-dev-middleware or @webpack-cli/serve for modern use. ↓
fix Migrate to webpack-dev-middleware for stats display.
gotcha Stats display may be verbose; cannot suppress all output without setting stats to false. ↓
fix Set stats: false to disable, or configure individual options.
Install
npm install webpack-info-plugin yarn add webpack-info-plugin pnpm add webpack-info-plugin Imports
- WebpackInfoPlugin wrong
import WebpackInfoPlugin from 'webpack-info-plugin';correctconst WebpackInfoPlugin = require('webpack-info-plugin'); - instance wrong
const info = new WebpackInfoPlugin.default(options);correctconst info = new WebpackInfoPlugin(options); - options.stats wrong
{ stats: { color: true } }correct{ stats: { colors: true, timings: true } }
Quickstart
const WebpackInfoPlugin = require('webpack-info-plugin');
module.exports = {
entry: './src/index.js',
output: { path: __dirname + '/dist', filename: 'bundle.js' },
plugins: [
new WebpackInfoPlugin({
stats: {
colors: true,
version: false,
hash: false,
timings: true,
assets: false,
chunks: false,
chunkModules: false,
modules: false
},
state: true
})
]
};