We provide online examples based on Rsbuild. These examples give you an intuitive sense of Rspack's build performance and Rsbuild's development experience:
Rsbuild supports using Node.js, Deno, or Bun as the JavaScript runtime.
You can refer to the following installation guides and choose a runtime:
Use create-rsbuild to create a new Rsbuild application. Run the following command:
Follow the prompts step by step. During setup, you can choose whether to add optional tools like TypeScript, ESLint, etc.
After creating the application, run these commands:
git init to initialize the Git repository.npm install (or the install command of your package manager) to install npm dependencies.npm run dev to start the development server, which runs on http://localhost:5173 by default.When creating an application, 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 provides basic templates out of the box. You can also get more templates in the following ways:
create-rsbuild can help you set up commonly used tools, including Biome, ESLint, and Prettier. Use the arrow keys and space bar to make your selections. If you don't need these tools, 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 ESLint or Prettier as well.
To create an application 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 application with one command.
For example, to create a React application in the my-app directory with one command:
All CLI flags supported by create-rsbuild:
To migrate from an existing project to Rsbuild, refer to the following guides:
If your project doesn't match the above migration guides, manually install the @rsbuild/core package:
After installation, 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: