webpack-dev-server

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

Tool
npm
v6.1.0
7,844 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 88
Maintenance 88
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

TypeScript
92%
MIT

GB Studio

Design Tools · Developer Tools · Game Development

9,434

Drag-and-drop retro Game Boy game creator that compiles real ROMs — no coding required.

View details
88
Repo Health
83
Technical
72
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
Ruby
66%
Other

GitLab

Developer Tools · Devops

24,537

The complete DevOps platform that unifies Git hosting, CI/CD, issue tracking, and security scanning into a single self-hostable application.

View details
87
Repo Health
86
Technical
65
Dependency
Built with
Ruby 66%
JavaScript 20%
Updated 1 weeks ago
TypeScript
83%
Apache 2.0

Grist

Databases · No Code Platforms

11,991

A modern relational spreadsheet that combines Python-powered formulas, drag-and-drop dashboards, and granular access controls in a self-hostable, SQLite-backed data platform.

View details
91
Repo Health
93
Technical
63
Dependency
Built with
TypeScript 83%
Python 11%
Updated 1 weeks ago
Go
62%
Apache 2.0

Harness Open Source

Code Editors · Developer Tools · Devops

38,684

A unified open source DevOps platform combining Git hosting, CI/CD pipelines, cloud development environments, and artifact registries in a single self-hosted system.

View details
90
Repo Health
79
Technical
64
Dependency
Built with
Go 62%
TypeScript 33%
Updated 1 weeks ago
TypeScript
62%
EPL-2.0

Huly Platform

Collaboration · Project Management · Team Chat

27,978

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
62
Dependency
Built with
TypeScript 62%
Svelte 34%
Updated 1 weeks ago
TypeScript
98%
MIT

isoflow

Design Tools · Developer Tools

1,728

A React component that lets developers embed a fully-featured, isometric network diagram editor directly into their applications.

View details
41
Repo Health
72
Technical
70
Dependency
Built with
TypeScript 98%
Updated 1 years ago
TypeScript
73%
Apache 2.0

Jitsi Meet

Collaboration · Team Chat · Video Conferencing

30,130

Open-source, end-to-end encrypted video conferencing you can self-host or embed into any web or mobile app.

View details
96
Repo Health
85
Technical
67
Dependency
Built with
TypeScript 73%
Lua 11%
JavaScript 10%
Updated 1 weeks ago
TypeScript
77%
Other

Joplin

Note Taking

56,853

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
60
Dependency
Built with
TypeScript 77%
JavaScript 14%
Updated 1 weeks ago
Python
51%
AGPL 3.0

Khoj

AI Assistants · Knowledge Management · Productivity

37,802

A self-hostable AI second brain that chats with your documents, searches the web, builds custom agents, and runs entirely on your own LLM.

View details
62
Repo Health
82
Technical
66
Dependency
Built with
Python 51%
TypeScript 36%
Updated 2 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