GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rstackjs/rspack-dev-server: Dev server for Rspack, modernized from webpack-dev-server.

BranchesTags
Open more actions menu

Latest commit

 

History

271 Commits
271 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents/skills/rstack-cli-docs
.agents/skills/rstack-cli-docs
 
 
.github
.github
 
 
.rstack/hooks
.rstack/hooks
 
 
.vscode
.vscode
 
 
client-src
client-src
 
 
docs
docs
 
 
example
example
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
rstack.config.ts
rstack.config.ts
 
 
skills-lock.json
skills-lock.json
 
 
tsconfig.client.json
tsconfig.client.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

@rspack/dev-server

npm version downloads node version license

Use Rspack with a development server that provides live reloading. This should be used for development only.

Versions

  • 2.x: For Rspack v2, see v1 -> v2 for migration guide.
  • 1.x: For Rspack v1, see v1.x - README for usage guide.

Installation

First of all, install @rspack/dev-server and @rspack/core by your favorite package manager:

# npm
$ npm install -D @rspack/dev-server @rspack/core

# yarn
$ yarn add -D @rspack/dev-server @rspack/core

# pnpm
$ pnpm add -D @rspack/dev-server @rspack/core

# bun
$ bun add -D @rspack/dev-server @rspack/core

Usage

There are two recommended ways to use @rspack/dev-server:

With the CLI

The easiest way to use it is with the @rspack/cli.

You can install it in your project by:

# npm
$ npm install -D @rspack/cli

# yarn
$ yarn add -D @rspack/cli

# pnpm
$ pnpm add -D @rspack/cli

# bun
$ bun add -D @rspack/cli

And then start the development server by:

# with rspack.config.js
$ rspack serve

# with custom config file
$ rspack serve -c ./your.config.js

See CLI for more details.

While starting the development server, you can specify the configuration by the devServer field of your Rspack config file:

// rspack.config.mjs
export default {
  devServer: {
    // the configuration of the development server
    port: 8080,
  },
};

See Rspack - devServer for all configuration options.

With the API

While it's recommended to run @rspack/dev-server via the CLI, you may also choose to start a server via the API.

import { RspackDevServer } from '@rspack/dev-server';
import { rspack } from '@rspack/core';
import config from './rspack.config.mjs';

const compiler = rspack(config);
const devServerOptions = {
  ...config.devServer,
  // override
  port: 8888,
};

const server = new RspackDevServer(devServerOptions, compiler);

server.startCallback(() => {
  console.log('Successfully started server on http://localhost:8888');
});

Credits

This repository is forked from webpack-dev-server. It adapts the original implementation for the Rspack ecosystem, bridging behavioral differences with webpack while adding Rspack-specific capabilities.

Thanks to the webpack-dev-server maintainers and its original creator, @sokra.

License

MIT licensed.

About

Dev server for Rspack, modernized from webpack-dev-server.

rspack.rs/config/dev-server

Topics

devserverrspack

Resources

Readme
MIT license
Activity
Custom properties

Stars

42 stars

Watchers

9 watching

Forks

9 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.