We provide online examples based on Rsbuild. These examples demonstrate 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:
npm create rsbuild@latestFollow the prompts to choose from available options. During setup, you can select whether to add optional tools like TypeScript and ESLint.
After creating the application, follow these steps:
git init to initialize a Git repository.npm install (or your package manager's install command) to install dependencies.npm run dev to start the dev 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. You can find more templates at:
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.
◆ Select additional tools (Use <space> to select, <enter> to continue) │ ◻ 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 add ESLint or Prettier.
To create an application in the current directory, set the target folder to .:
◆ Create Rsbuild Project │ ◇ Project name or path │ . │ ◇ "." is not empty, please choose: │ Continue and override filescreate-rsbuild supports a non-interactive mode through command-line options. This mode lets you skip all prompts and create a project directly, which is useful for scripts, CI, and coding agents.
For example, the following command creates a React app in the my-app directory:
npx -y create-rsbuild@latest my-app --template react # Using abbreviations npx -y create-rsbuild@latest my-app -t react # Specify multiple tools npx -y create-rsbuild@latest my-app -t react --tools eslint --tools prettierAll CLI flags supported by create-rsbuild:
Usage: create-rsbuild [dir] [options] Options: -h, --help display help for command -d, --dir <dir> create project in specified directory -t, --template <tpl> specify the template to use --tools <tool> select additional tools (biome, eslint, prettier) --override override files in target directory --packageName <name> specify the package name Templates: react-js, react-ts, vue3-js, vue3-ts, vue2-js, vue2-ts, svelte-js, svelte-ts, solid-js, solid-ts, vanilla-js, vanilla-tsTo migrate from an existing project to Rsbuild, refer to the following guides:
If your project doesn't match the above migration guides, you can manually install the @rsbuild/core package:
npm add @rsbuild/core -DAfter installation, refer to the following documents to configure your project:
Rsbuild includes a lightweight CLI with commands like dev and build.
{ "scripts": { // start the dev server "dev": "rsbuild dev", // build 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.
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.
export default { source: { entry: { foo: './src/pages/foo/index.ts', bar: './src/pages/bar/index.ts', }, }, };Rsbuild core package, providing CLI commands and JavaScript API.
Create a new Rsbuild project.
You may want: