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:
Then follow the prompts to complete the operation.
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 |
vue3 | 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.
If you need to create a project in the current directory, you can 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
:
If you need to migrate from an existing project to Rsbuild, you can refer to the following guides:
For other types of projects, you can manually install the @rsbuild/core package:
Then refer to the guide and documentation to enable the features you need:
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: