@rspack/dev-server

Development server for Rspack with WebSocket-based hot module replacement, live reload, and a webpack-dev-server-compatible API.

Tool
npm
v2.2.1
42stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
69/100Good
Development Activity88
Maintenance96
Community28
Maturity44
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
70/100Good
Architecture65
Code Quality72
Innovation68
Learning Curve75

@rspack/dev-server is the official development server for Rspack, the Rust-based successor to webpack. It wraps a compiler instance with an HTTP(S) server, WebSocket-driven hot module replacement, live reload, static file serving, and a request proxy — the same feature set webpack-dev-server established, ported to Rspack’s build pipeline via @rspack/dev-middleware.

It ships as both a CLI-invoked server (rspack serve, provided by @rspack/cli) and a programmatic RspackDevServer class, so teams migrating from webpack keep a familiar devServer configuration object — proxy rules, HTTPS certs via selfsigned, custom WebSocket server implementations, and static-file options all carry over — while getting Rspack’s faster incremental rebuilds underneath.

What You Get

  • Hot module replacement over WebSockets with an injected client overlay for build errors
  • Live reload fallback for changes that can’t be hot-applied
  • Pluggable HTTP server backends (native http/https, Express, Connect, or Hono) via the server option
  • Built-in HTTPS support with automatic self-signed certificate generation
  • Reverse proxy configuration for routing requests to a separate backend during development
  • History API fallback for client-side-routed single-page apps

Common Use Cases

  • Running rspack serve locally during frontend development for instant HMR feedback
  • Migrating a webpack-dev-server-based project to Rspack while keeping the same devServer config shape
  • Proxying API requests to a backend service while serving Rspack-built assets from the same origin
  • Serving an app over HTTPS locally to test OAuth callbacks, secure cookies, or service workers
  • Embedding a dev server programmatically (via RspackDevServer) inside a custom CLI or test harness

Under The Hood

Architecture The package centers on a single Server class (src/server.ts, ~2,700 lines) that wires together @rspack/dev-middleware for compiled-asset serving, a WebsocketServer (extending a shared BaseServer) for the HMR/live-reload transport, static file and history-API-fallback handling, HTTPS certificate setup, and reverse proxying. Config normalization lives in config.ts, producing a ResolvedDevServer shape consumed by Server. The public entry point (src/index.ts) re-exports only RspackDevServer and a re-exported Configuration type from @rspack/core, keeping the external surface deliberately thin even though most logic is concentrated in one large file — a direct consequence of this being a close fork of webpack-dev-server’s monolithic-server pattern rather than a redesigned modular architecture. A separately bundled client (client-src/) handles the browser side of the WebSocket protocol, message parsing, and error overlay rendering.

Tech Stack Written in TypeScript, published as ESM only, targeting Node 20.19+/22.12+. Core runtime dependencies include @rspack/dev-middleware for serving compiled output, ws for the WebSocket transport, pluggable HTTP layers via express, connect-next, and hono, http-proxy-middleware for request proxying, selfsigned for on-demand HTTPS certificates, chokidar for file watching, and launch-editor for click-to-open-in-editor support from error overlays. The project is built and tested through an internal monorepo toolchain (rstack/rs CLI commands for build, lint, and test), with @microsoft/api-extractor rolling up type declarations for publication.

Code Quality Testing spans unit tests (e.g. ansiHTML.test.ts), a Puppeteer-driven e2e/ suite exercising real browser behavior, and a type-tests/ directory validating the public TypeScript API — a genuinely layered test setup, though the normalizeOptions.test.ts snapshot suite is currently describe.skipped rather than running. Error handling favors explicit, typed checks over silent swallowing (getPort.ts inspects NodeJS.ErrnoException codes and rethrows anything unexpected rather than catching broadly). Types are strict and comprehensive (types.ts, config.ts), naming is consistent, and CI (.github/workflows/test.yml) runs the test suite across both Ubuntu and Windows runners plus a separate lint/format check job.

API Design The public API is intentionally narrow: one RspackDevServer class plus a re-exported Configuration type, so integrators have a single entry point and a single options object to learn rather than assembling several plugin configs. The zero-config CLI path (rspack serve) covers the common case, and the programmatic path (new RspackDevServer(options, compiler)) requires only a few lines to start a server. Because this is a close adaptation of webpack-dev-server, it doesn’t introduce new API conventions of its own, but it inherits years of upstream refinement — pluggable server implementations, an array-based proxy config, static-file options — while swapping in Rspack-specific internals like @rspack/dev-middleware. Documentation beyond the README lives externally on the rspack.rs config site rather than in embedded guides.

Used by 5 apps in this directory

TypeScript
87%
Other

AFFiNE

Productivity · Project Management · Note Taking

72,238

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript87%
Updated yesterday
Python
63%
BSD 3

Flagsmith

Developer Tools · Devops · Ab Testing Experimentation

6,539

Open-source feature flagging, remote config, and A/B/multivariate testing platform for web, mobile, and server-side apps — self-host or use the hosted SaaS.

View details
90
Repo Health
82
Technical
63
Dependency
Built with
Python63%
TypeScript31%
Updated 2 days ago
Ruby
67%
Other

GitLab

Devops · Developer Tools

24,552

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
68
Dependency
Built with
Ruby67%
JavaScript20%
Updated today
Clojure
55%
Other

Metabase

Analytics

49,109

The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.

View details
95
Repo Health
84
Technical
65
Dependency
Built with
Clojure55%
TypeScript40%
Updated today
Python
58%
Other

Sentry

Security · Developer Tools · Monitoring

44,739

Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.

View details
95
Repo Health
80
Technical
69
Dependency
Built with
Python58%
TypeScript41%
Updated yesterday

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

Search