Quick Start

Online Example

We provide an online example based on Rsbuild. The example gives an intuitive feel for the build performance of Rspack and the development experience of Rsbuild:

Setup Environment

Before getting started, you will need to install Node.js >= version 16, it is recommended to use the Node.js LTS version.

Check the current Node.js version with the following command:

node -v

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

Here is an example of how to install via nvm:

# Install Node.js LTS
nvm install --lts
# Switch to Node.js LTS
nvm use --lts

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.


When creating a project, uou 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

Optional Tools

create-rsbuild can help you set up some commonly used tools, including Biome, ESLint, and prettier. You can use the arrow keys and the space bar to make your selections. If you don't need these tools, you can simply press Enter to skip.

◆  Select additional tools (use arrow keys / space bar)
│  ◻ Add Biome for code linting and formatting
│  ◻ Add ESLint for code linting
│  ◻ Add Prettier for code formatting

Biome provides similar linting and formatting features to ESLint and Prettier. If you select Biome, you typically won't need to choose ESLint or Prettier as well.

Current Directory

If you need to create a project in the current directory, you can set the target folder to .:

◆  Create Rsbuild Project
◇  Input target folder
│  .
◇  "." is not empty, please choose:
│  Continue and override files

Migrate from Existing Projects

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

Other Projects

For other types of projects, you can manually install the @rsbuild/core package:

npm add @rsbuild/core -D

Then refer to the guide and documentation to enable the features you need:

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 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: