{"id":20794,"library":"webpack-messages","title":"webpack-messages","description":"A Webpack plugin that formats and displays messages throughout the bundle lifecycle, including compile start, success, warnings, and errors. Version 2.0.4 is the current stable release, compatible with Webpack 3.x and 4.x. It uses kleur for colorization and provides hooks for custom loggers and completion callbacks. Unlike similar plugins, it supports named bundles for multi-compiler setups and has a minimal footprint. Releases are infrequent but address critical compatibility issues and deprecation warnings.","status":"active","version":"2.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/lukeed/webpack-messages","tags":["javascript","bundle","webpack","create-react-app","webpack-plugin","formatting","messages","console","pretty"],"install":[{"cmd":"npm install webpack-messages","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-messages","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-messages","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for colorized output","package":"kleur","optional":false},{"reason":"Provides message formatting logic","package":"webpack-format-messages","optional":false}],"imports":[{"note":"The package exports a single constructor function, not a named export. Use CommonJS require with default.","wrong":"import WebpackMessages from 'webpack-messages'; or const { WebpackMessages } = require('webpack-messages');","symbol":"WebpackMessages","correct":"const WebpackMessages = require('webpack-messages');"},{"note":"In v2, the default export is the constructor itself. No .default property.","wrong":"const WebpackMessages = require('webpack-messages').default;","symbol":"WebpackMessages","correct":"const WebpackMessages = require('webpack-messages');"},{"note":"No TypeScript types shipped; install @types/webpack-messages if needed.","wrong":"Works with CommonJS only; no ES module export.","symbol":"WebpackMessages","correct":"// In TypeScript, use require or install @types/webpack-messages"}],"quickstart":{"code":"// webpack.config.js\nconst WebpackMessages = require('webpack-messages');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    filename: 'bundle.js'\n  },\n  plugins: [\n    new WebpackMessages({\n      name: 'client',\n      logger: str => console.log(`>> ${str}`)\n    })\n  ]\n};","lang":"javascript","description":"Adds WebpackMessages plugin to Webpack config with custom logger and bundle name."},"warnings":[{"fix":"Use Node >=6 or downgrade to v1.0.x.","message":"v2.0.0 dropped support for Node <6. If you need older Node, stick with v1.x.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use v1.x if you need chalk compatibility.","message":"v2.0.0 replaced chalk with ansi-colors and then later switched to kleur. If you rely on color customization via chalk, it may not work.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use require('webpack-messages') or configure bundler to allow CJS.","message":"The package uses CommonJS only; importing via ES module 'import' will fail in bundlers that enforce ESM.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update to v1.0.1+.","message":"Switched from 'compilation' to 'compile' event in v1.0.1. If using a plugin that re-triggers compilation (e.g., Hot Module Replacement), onStart might fire multiple times.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use const WebpackMessages = require('webpack-messages'); not const { WebpackMessages } = require('webpack-messages');","cause":"Importing the package as a named export instead of default.","error":"TypeError: WebpackMessages is not a constructor"},{"fix":"Make sure webpack-format-messages is installed: npm install webpack-messages webpack-format-messages","cause":"Missing peer dependency when installing with npm@3 or older.","error":"Error: Cannot find module 'webpack-format-messages'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}