Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.2 KB

File metadata and controls

43 lines (29 loc) · 1.2 KB

dev

The rs dev command starts the Rsbuild development server for an application. It compiles the source code in development mode, watches for changes, and applies hot module replacement (HMR) or reloads the page as needed.

Usage

rs dev [options]

The command loads the application configuration registered with define.app().

Options

rs dev supports the same development server options as Rsbuild. See the Rsbuild CLI documentation for details.

Examples:

# Start the server and open the page in the browser
rs dev --open

# Use port 8080 and fail if it is already in use
rs dev --port 8080 --strict-port

# Make the server available on the local network
rs dev --host

Configuration

Configure the development server through define.app() in the Rstack configuration file. It accepts the standard Rsbuild configuration:

import { define } from 'rstack';

define.app({
  server: {
    open: true,
    port: 8080,
  },
});