webpack-dev-server

The official live-reloading development server for webpack, with hot module replacement, HTTPS, and proxying built in.

Tool
npm
v6.0.0
7,837 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
94 /100 Excellent
Development Activity 100
Maintenance 96
Community 80
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 78
Code Quality 92
Innovation 62
Learning Curve 80

webpack-dev-server is the official development server for webpack. It wraps webpack-dev-middleware to serve compiled assets straight from memory, then layers on a browser client (delivered over a WebSocket connection) that reloads the page or hot-swaps modules the instant a rebuild finishes. Most projects reach it through webpack serve on the webpack CLI rather than importing it directly, though it also exposes a programmatic Server class for custom setups.

Beyond the reload loop, it behaves like a small application server for the development phase: it can serve static assets from a directory, proxy API requests to a backend with http-proxy-middleware, terminate HTTPS with a self-signed or supplied certificate, broadcast itself on the local network via Bonjour/ZeroConf, and fall back to an index page for single-page-application routing. Every option is validated at startup against a bundled JSON schema, so misconfigurations fail fast with a clear error instead of a silent no-op.

Security is treated as a first-class concern rather than an afterthought: host-header and cross-origin checks run before any other middleware, and allowedHosts supports an explicit allowlist, auto (validate against the bound interfaces), or all (opt out entirely) for the cases where dev servers get proxied or tunneled. A full-screen browser overlay can be scoped independently to compilation errors, compilation warnings, and uncaught runtime errors, with an optional Trusted Types policy name for CSP-locked pages.

What You Get

  • In-memory asset serving via webpack-dev-middleware — no assets written to disk during development
  • Live reload and Hot Module Replacement (HMR) driven by a WebSocket connection between server and browser client
  • Configurable HTTP proxying to a backend API through http-proxy-middleware, including WebSocket-aware proxying
  • HTTPS support with auto-generated self-signed certificates or your own key/cert/CA/PFX
  • Static file serving with directory listing, custom public paths, and file watching for non-compiled assets
  • A full-screen error/warning overlay in the browser with independent toggles for compile errors, compile warnings, and runtime errors
  • Local network discovery via Bonjour/ZeroConf and a local-ip/local-ipv4/local-ipv6 host resolver
  • Built-in security middleware — host-header validation and cross-origin request checks ahead of the rest of the pipeline

Common Use Cases

  • Running a local dev environment for a webpack-based frontend with instant browser refresh on save
  • Developing a single-page application that needs HTML5 History API fallback so client-side routes resolve correctly
  • Proxying /api requests from the dev server to a separately-running backend during full-stack development
  • Testing HTTPS-only browser features (service workers, secure cookies, geolocation) locally with a self-signed certificate
  • Previewing a site on a phone or another device on the same network via the Bonjour-broadcast dev server

Under The Hood

Architecture The package centers on a single Server class (lib/Server.js) that takes a webpack Compiler/MultiCompiler and an options object, validates the options against a bundled JSON schema (lib/options.json) via schema-utils, and then runs a defined lifecycle: normalizeOptions resolves and defaults every option, initialize wires up the Express-based app, creates the underlying HTTP/HTTPS/HTTP2 server, and sets up file watching, and setupMiddlewares assembles an ordered middleware chain — starting with host-header and cross-origin security checks, then compression, static serving, history-API fallback, proxying, and the webpack-dev-middleware bridge itself. A parallel client-src/ tree holds the browser-side runtime (the WebSocket client, overlay, progress indicator, logger) which is transpiled separately with Babel and bundled with webpack before being injected into served pages, keeping the Node-side server and browser-side client as clearly separated concerns despite living in one repository.

Tech Stack Built on Node.js ESM with Express 5 as the HTTP layer, chokidar for filesystem watching, ws for the WebSocket transport between server and client, http-proxy-middleware for request proxying, bonjour-service for ZeroConf broadcasting, and selfsigned for on-the-fly HTTPS certificates. Public types are generated from JSDoc annotations via tsc --declaration --emitDeclarationOnly, and the CommonJS (dist/) and ESM (lib/) builds are produced separately with Babel so consumers can require or import the package interchangeably; webpack itself is an optional peer dependency, lazily imported only when actually needed.

Code Quality Tests run on Node’s built-in node:test runner (no separate test framework dependency) with the expect assertion library and jest-mock for spies/mocks, organized into test/server, test/client, test/cli, and test/e2e (browser-driven tests via Puppeteer), plus coverage collection through --experimental-test-coverage with an lcov reporter. Linting combines ESLint (typescript-eslint, import-order, jsdoc rules), Prettier formatting, and cspell spell-checking, all enforced pre-commit through Husky and lint-staged, with commitlint gating commit messages and changesets managing versioned releases — a comprehensive quality gate for a project of this maturity.

What Makes It Unique Rather than bundling a fixed web-socket implementation, the server abstracts the transport behind a pluggable webSocketServer option and a matching browser-side client contract, and the reload overlay itself is split into independently toggleable channels (compile errors, compile warnings, uncaught runtime errors) with support for a named Trusted Types policy — a level of granularity aimed squarely at CSP-restricted production-adjacent dev setups rather than the common case. Combined with the layered host-header/cross-origin security checks that run ahead of every other middleware, the project treats a dev server exposed on a local network as something that needs hardening by default, not just a convenience wrapper around static file serving.

Used by 38 apps in this directory

Python
47%
Other

Airbyte

Data Engineering · Developer Tools

22,143

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
67
Dependency
Built with
Python 47%
Kotlin 43%
Updated 4 days ago
JavaScript
94%
MIT

Another Redis Desktop Manager

Databases · Developer Tools

34,787

Fast, stable Redis GUI with cluster, SSH, and massive key support

View details
81
Repo Health
56
Technical
67
Dependency
Built with
JavaScript 94%
Updated 1 months ago
TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 68%
Java 21%
Updated 6 days ago
Go
85%
Apache 2.0

Argo Workflows

Data Engineering · Devops

17,006

The most popular Kubernetes-native workflow engine for orchestrating containerized DAGs, ML pipelines, CI/CD, and parallel batch jobs at scale.

View details
96
Repo Health
90
Technical
68
Dependency
Built with
Go 85%
TypeScript 11%
Updated 4 days ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,650

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
67
Repo Health
76
Technical
62
Dependency
Built with
JavaScript 90%
Updated 3 weeks ago
PHP
78%
Other

Craft CMS

CMS

3,609

A developer-first PHP CMS with clean-slate content modeling, auto-generated GraphQL API, and a four-tier edition system that scales from solo projects to enterprise deployments.

View details
96
Repo Health
83
Technical
62
Dependency
Built with
PHP 78%
JavaScript 14%
Updated 5 days ago
Ruby
39%
AGPL 3.0

DocuSeal

Digital Signiture

18,629

Open source document signing platform with WYSIWYG PDF builder, multi-party workflows, REST API, and full self-hosting via Docker.

View details
87
Repo Health
80
Technical
69
Dependency
Built with
Ruby 39%
Vue 28%
HTML 20%
Updated 1 weeks ago
TypeScript
94%
AGPL 3.0

Element Web

Collaboration · Team Chat

13,518

A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.

View details
96
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 94%
Updated 5 days ago
TypeScript
54%
Other

Focalboard

Collaboration · Productivity · Project Management

26,491

Self-hosted, open source project management with Kanban, table, gallery, and calendar views — a privacy-first alternative to Trello, Notion, and Asana.

View details
56
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 54%
Go 40%
Updated 4 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers