Registry / web-framework / webpack-dev-server

webpack-dev-server

JSON →
library5.2.3jsnpmunverified

A development server that provides live reloading for webpack projects, using webpack-dev-middleware for fast in-memory asset access. Current stable version is 5.2.3 (released January 2026). Active maintenance with frequent patch releases. Major differentiating features include: live reloading, HMR, overlay for runtime errors, proxy for API forwarding, HTTPS support, and TypeScript type definitions. Requires Node >= 18.12.0 and webpack ^5.0.0 as peer dependency. Breaking changes in v5 include stricter CORS and WebSocket security, removal of certain options like `inline` and `lazy`, and migration from webpack-cli v4 to v5.

npm install webpack-dev-server
INSTALL
IMPORT
SIG · WEBPACK-DEV-SERVER
W
webpack-dev-server
web-frameworkjavascriptv5.2.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

webpack-dev-server
npx webpack serve
npx webpack-dev-server
Use 'webpack serve' CLI command; 'webpack-dev-server' bin is deprecated in v5.
WebpackDevServer
import WebpackDevServer from 'webpack-dev-server';
const WebpackDevServer = require('webpack-dev-server');
ESM-only since v5; default export for API usage.
Configuration
import type { Configuration } from 'webpack-dev-server';
import { Configuration } from 'webpack';
TypeScript users should import the server-specific Configuration type from 'webpack-dev-server'.

Shows programmatic usage of WebpackDevServer with ESM imports, async start, and hot module replacement enabled.

// webpack.config.js (ESM) import WebpackDevServer from 'webpack-dev-server'; import webpack from 'webpack'; const compiler = webpack({ /* webpack config */ }); const devServerOptions = { port: 3000, hot: true }; const server = new WebpackDevServer(devServerOptions, compiler); async function start() { await server.start(); console.log('Dev server running on http://localhost:3000'); } start();
webpack-dev-server --version
Debug
Known issues
breakingCross-origin requests are not allowed unless allowed by Access-Control-Allow-Origin header; requests with IP addresses in Origin header are not allowed to connect to WebSocket server unless configured by allowedHosts.
fix
Configure allowedHosts or ensure Origin header matches Host for WebSocket connections.
affects: >=5.2.1
breakingSecurity: bump webpack-dev-middleware to address directory traversal vulnerability.
fix
Upgrade to webpack-dev-server >=5.0.4 (or >=4.15.2 for v4).
affects: <5.0.4
deprecatedOptions 'inline', 'lazy', 'noInfo', 'reporter', 'quiet', 'colors' are removed in v5.
fix
Use webpack-dev-server v4 or adjust config (e.g., use 'client.webSocketURL' instead of 'inline').
affects: >=5.0.0
gotchaUsing 'webpack-dev-server' bin directly (e.g., npx webpack-dev-server) is deprecated in favor of 'webpack serve'.
fix
Run 'npx webpack serve' instead, which integrates with webpack-cli.
affects: >=5.0.0
gotchaTypeScript types for Configuration require explicit import from 'webpack-dev-server'.
fix
Use 'import type { Configuration } from 'webpack-dev-server';' not from 'webpack'.
affects: >=5.0.0
Errors
Common errors & fixes
Cannot find module 'webpack-dev-server'
Missing local installation or using deprecated CLI command without local webpack-dev-server.
fix
Run 'npm install --save-dev webpack-dev-server' in project directory.
Error: listen EADDRINUSE :::8080
Port 8080 already in use by another process.
fix
Change port in config (e.g., --port 3000) or kill process using the port.
Invalid configuration object. webpack-dev-server has been initialized using a configuration object that does not match the API schema.
Using a deprecated option (e.g., 'inline', 'lazy') in v5 config.
fix
Remove deprecated options. See migration guide: https://github.com/webpack/webpack-dev-server/releases/tag/v5.0.0
Upgrade
Version history
5.2.3latest on npm
Audit
Dependencies
webpackrequiredpeer dependency - core bundler required
Agent activity
38 hits · last 30 days
node
34
Amazon
1
OpenAI (training)
1
Resources
webpack-dev-server — npm install webpack-dev-server · libregistry