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:
Rsbuild supports using Node.js, Deno, or Bun as the runtime.
For Node.js, 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:
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:
You can use the create-rsbuild
to create a new Rsbuild project. Just execute the following command:
Follow the prompts step by step. During the creation process, you can choose whether you need additional tools like TypeScript, ESLint, etc.
After the project is created, you can follow these steps:
git init
to initialize the Git repository.npm install
(or the install command of your package manager) to install project dependencies.npm run dev
to start the development server, which runs on localhost:5173
by default.When creating a project, you can choose from the following templates provided by create-rsbuild
:
Template | Description | Optional Features |
---|---|---|
vanilla | Vanilla JavaScript | TypeScript |
react | React 19 | TypeScript |
react18 | React 18 | TypeScript |
vue | Vue 3 | TypeScript |
vue2 | Vue 2 | TypeScript |
lit | Lit | TypeScript |
preact | Preact | TypeScript |
svelte | Svelte 5 | TypeScript |
solid | Solid | TypeScript |
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.
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.
To create a project in the current directory, set the target folder to .
:
create-rsbuild provides some CLI flags. By setting these CLI flags, you can skip the interactive selection steps and create the project with one command.
For example, to create a React project in the my-project
directory with one command:
All the CLI flags of create-rsbuild
:
To migrate from an existing project to Rsbuild, refer to the following guides:
If your project does not belong to the above migration guides, you can manually install the @rsbuild/core package:
After installation, you can refer to the following documents to configure your project:
Rsbuild comes with a lightweight CLI that includes commands such as dev
and build
.
Refer to the CLI to learn about all available commands and options.
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.
Rsbuild core package, providing CLI commands and JavaScript API.
Create a new Rsbuild project.
You may want: