webpack-dashboard provides a real-time, rich command-line interface (CLI) dashboard for monitoring webpack's build process, especially useful during development with `webpack-dev-server`. It visualizes bundle stats, build progress, module tree, and errors in an interactive terminal UI, offering a significant upgrade from standard console output. The current stable version is 3.3.8, with patch releases occurring periodically for bug fixes and dependency updates, while minor/major versions introduce features or address breaking changes (e.g., v3.0.0 migrated terminal renderers and updated Node.js requirements). Key differentiators include its visual clarity, interactive elements, and consolidation of disparate build information into a single, organized view, making it easier to identify performance bottlenecks or build failures.
npm install webpack-dashboardVerified import paths — ran on the pinned version, not inferred.
This quickstart shows how to integrate webpack-dashboard into a webpack configuration and how to execute it via the CLI, including custom port configuration for the dashboard.
Upgrade Node.js to version 8 or later, or downgrade `webpack-dashboard` to a 2.x version if Node.js upgrade is not feasible.
Choose a unique, unused port for `webpack-dashboard` (e.g., `new DashboardPlugin({ port: 3001 })`) and pass the matching port to the CLI (`webpack-dashboard --port 3001 -- webpack`).No direct fix required, but be aware that minor visual discrepancies in terminal rendering might occur if upgrading from pre-3.0.0 versions.
Always include `--` between `webpack-dashboard` and the webpack command, e.g., `webpack-dashboard -- webpack` or `webpack-dashboard -- webpack-dev-server`.
Utilize keyboard shortcuts (`Page Up`, `Page Down`, `↑`, `↓`) for navigating content within the dashboard on Windows terminals.
Configure a custom, unused port for `webpack-dashboard` in your webpack config (e.g., `new DashboardPlugin({ port: 9876 })`) and pass the same port to the CLI (`webpack-dashboard --port 9876 -- webpack-dev-server`).If installed locally, ensure you are running it through `npm run <script-name>` (e.g., `npm run dev` where `"dev": "webpack-dashboard -- webpack serve"`). If you intend a global install, run `npm install -g webpack-dashboard`.
Use `const DashboardPlugin = require('webpack-dashboard/plugin');` instead of `import { DashboardPlugin } from 'webpack-dashboard/plugin';` or similar ES module syntax.Ensure `new DashboardPlugin()` is correctly added to `module.exports.plugins` in your webpack config. Also, verify your `package.json` script prepends `webpack-dashboard --` to your webpack command (e.g., `"dev": "webpack-dashboard -- webpack serve"`).