Quick Start

Setup Environment

Before getting started, you will need to install Node.js, and ensure that your Node.js version >= 16. We recommend using the LTS version of Node.js 20.

You can check the currently used Node.js version with the following command:

node -v

If you do not have Node.js installed in your current environment, or the installed version is too low, you can use nvm or fnm to install the required version.

Here is an example of how to install the Node.js 20 LTS version via nvm:

# Install the long-term support version of Node.js 20
nvm install 20 --lts

# Make the newly installed Node.js 20 as the default version
nvm alias default 20

# Switch to the newly installed Node.js 20
nvm use 20

Creating an Rsbuild Project

You can use the create-rsbuild to create a new Rsbuild project. Just execute the following command:

npm create rsbuild@latest

Then follow the prompts to complete the operation. You can choose from the following templates provided by create-rsbuild:

Template Description Optional Features
react React 18 TypeScript
vue3 Vue 3 TypeScript
vue2 Vue 2 TypeScript
lit Lit TypeScript
preact Preact TypeScript
svelte Svelte TypeScript
solid Solid TypeScript
vanilla Vanilla JavaScript TypeScript

Migrate from Existing Projects

If you need to migrate from an existing project to Rsbuild, you can refer to the following guides:

Command Line Interface

Rsbuild comes with a lightweight CLI that includes commands such as dev and build.

  "scripts": {
    // starting the dev server
    "dev": "rsbuild dev",
    // build the app for production
    "build": "rsbuild build",
    // preview the production build locally
    "preview": "rsbuild preview"

Refer to the CLI Tool to learn about all available commands and options.

Entry Module

By default, Rsbuild CLI uses src/index.(js|ts|jsx|tsx) as the entry module. You can modify the entry module using the source.entry option.

Next Step

You may want: