A Koa 2 middleware for Rspack development and hot reloading. Current stable version 0.4.0, released under Apache-2.0 license with weekly releases. Supports ESM-only with TypeScript types. Key differentiators: designed specifically for Koa 2, integrates with memfs for in-memory file systems, and provides built-in hot reloading without Webpack dependencies. Requires Node.js >=18 and peer deps @rspack/core >=1.0.7 and koa >=2.0.0. Tree-shakable with no side effects.
npm install rspack-dev-middlewareNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a Koa server with Rspack dev middleware, using memfs for in-memory file output and hot reloading.
Use import syntax or dynamic import().
Pass a custom `fs` object (e.g., memfs) to middleware options.
Wrap multiple compilers in a multi-compiler if needed, but note that rspack-dev-middleware only accepts a single compiler.
Use `app.use(await dev(compiler, options))`.
Change to dynamic import or set type: 'module' in package.json.
Pass a single compiler object, e.g., `rspack({...})`.Install koa: npm install koa.