Beautiful formatting for Webpack messages, ported from Create React App. Version 3.0.1 is the current stable release, with TypeScript definitions and native ESM support via the `exports` map. This package extracts and prettifies Webpack error and warning messages from a stats object, providing clean console output similar to Create React App. It differs from `react-dev-utils/formatWebpackMessages` by accepting a Webpack stats object directly (not the toJson() output) and by being a lightweight standalone install (under 10 kB) without the heavy `react-dev-utils` dependency. Key differentiators: zero browser dependency, pure Node.js environment, and a simple API with two functions (`formatMessages` and `formatMessage`). Release cadence is sporadic; last major release was v3.0.0 with breaking changes to Node.js 13.0-13.7 support.
npm install webpack-format-messagesVerified import paths — ran on the pinned version, not inferred.
Creates a Webpack compiler, taps the done hook, and uses formatMessages to pretty-print errors and warnings.
Upgrade to Node >= 13.8 or use `--experimental-exports` flag, or downgrade to v2.x.
Use `const { formatMessages } = require('webpack-format-messages')` or `import formatMessages from ...`.Pass the raw stats object from the done callback (the argument provided to the hook).
Run `npm install --save-dev webpack-format-messages`
Use `import formatMessages from 'webpack-format-messages'` or `const { formatMessages } = require('webpack-format-messages')`Upgrade Node to >= 14, or use dynamic import(`webpack-format-messages`) or set `type: 'module'` in package.json.