Rsbuild — Rust-Powered Build Tool
You are an expert in Rsbuild, the Rspack-based build tool for web applications. You help developers configure fast builds for React, Vue, Svelte, and vanilla projects with Webpack-compatible plugin ecosystem, built-in TypeScript/CSS/asset support, module federation, and 5-10x faster builds than Webpack — providing a drop-in replacement that reuses existing Webpack loaders and plugins.
Core Capabilities
Configuration
// rsbuild.config.ts
import { defineConfig } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import { pluginSass } from "@rsbuild/plugin-sass";
import { pluginTypeCheck } from "@rsbuild/plugin-type-check";
export default defineConfig({
plugins: [
pluginReact(),
pluginSass(),
pluginTypeCheck(),
],
source: {
entry: { index: "./src/index.tsx" },
alias: { "@": "./src" },
},
output: {
target: "web",
distPath: { root: "dist" },
polyfill: "usage", // Auto-polyfill based on browserslist
cleanDistPath: true,
assetPrefix: process.env.CDN_URL || "/",
},
html: {
title: "My App",
favicon: "./src/assets/favicon.ico",
template: "./public/index.html",
},
server: {
port: 3000,
proxy: {
"/api": {
target: "http://localhost:8080",
changeOrigin: true,
},
},
},
performance: {
chunkSplit: {
strategy: "split-by-experience", // Auto-split React, lodash, etc.
},
bundleAnalyze: process.env.ANALYZE === "true"
? { analyzerMode: "static" }
: undefined,
},
tools: {
// Use existing Webpack loaders
rspack: (config) => {
config.module?.rules?.push({
test: /\.graphql$/,
use: "graphql-tag/loader",
});
},
},
});
Usage
# Create new project
npm create rsbuild@latest
# Development
npx rsbuild dev # HMR dev server
# Production build
npx rsbuild build # Optimized production bundle
# Preview
npx rsbuild preview # Serve production build locally
Installation
npm install -D @rsbuild/core @rsbuild/plugin-react
Best Practices
- Webpack compatibility — Reuse existing Webpack loaders via
tools.rspack; most plugins work without changes
- Plugin system — Use official plugins for React, Vue, Svelte, Sass, Less, TypeScript; composable and fast
- Auto code splitting —
split-by-experience strategy auto-splits vendor libraries; optimal chunking out of box
- Polyfill on demand — Set
polyfill: "usage" with browserslist; only includes polyfills for target browsers
- Module Federation — Built-in support for micro-frontends; share components between independently deployed apps
- Type checking — Use
pluginTypeCheck() for parallel TypeScript checking; doesn't slow down builds
- Proxy for API — Configure dev server proxy; avoid CORS issues during development
- 5-10x faster — Rspack (Rust) core provides Webpack semantics at native speed; same configs, faster builds
1---2name: rsbuild3description: >-4 You are an expert in Rsbuild, the Rspack-based build tool for web5 applications. You help developers configure fast builds for React, Vue,6 Svelte, and vanilla projects with Webpack-compatible plugin ecosystem,7 built-in TypeScript/CSS/asset support, module federation, and 5-10x faster8 builds than Webpack — providing a drop-in replacement that reuses existing9 Webpack loaders and plugins.10license: Apache-2.011compatibility: ''12metadata:13 source: https://skillmd.com/skills/eliferjunior/rsbuild14 author: terminal-skills15 version: 1.0.016 category: Developer Tools17 tags:18 - bundler19 - rust20 - rspack21 - fast22 - webpack-compatible23 - build-tool24---2526# Rsbuild — Rust-Powered Build Tool2728You are an expert in Rsbuild, the Rspack-based build tool for web applications. You help developers configure fast builds for React, Vue, Svelte, and vanilla projects with Webpack-compatible plugin ecosystem, built-in TypeScript/CSS/asset support, module federation, and 5-10x faster builds than Webpack — providing a drop-in replacement that reuses existing Webpack loaders and plugins.2930## Core Capabilities3132### Configuration3334```typescript35// rsbuild.config.ts36import { defineConfig } from "@rsbuild/core";37import { pluginReact } from "@rsbuild/plugin-react";38import { pluginSass } from "@rsbuild/plugin-sass";39import { pluginTypeCheck } from "@rsbuild/plugin-type-check";4041export default defineConfig({42 plugins: [43 pluginReact(),44 pluginSass(),45 pluginTypeCheck(),46 ],47 source: {48 entry: { index: "./src/index.tsx" },49 alias: { "@": "./src" },50 },51 output: {52 target: "web",53 distPath: { root: "dist" },54 polyfill: "usage", // Auto-polyfill based on browserslist55 cleanDistPath: true,56 assetPrefix: process.env.CDN_URL || "/",57 },58 html: {59 title: "My App",60 favicon: "./src/assets/favicon.ico",61 template: "./public/index.html",62 },63 server: {64 port: 3000,65 proxy: {66 "/api": {67 target: "http://localhost:8080",68 changeOrigin: true,69 },70 },71 },72 performance: {73 chunkSplit: {74 strategy: "split-by-experience", // Auto-split React, lodash, etc.75 },76 bundleAnalyze: process.env.ANALYZE === "true"77 ? { analyzerMode: "static" }78 : undefined,79 },80 tools: {81 // Use existing Webpack loaders82 rspack: (config) => {83 config.module?.rules?.push({84 test: /\.graphql$/,85 use: "graphql-tag/loader",86 });87 },88 },89});90```9192### Usage9394```bash95# Create new project96npm create rsbuild@latest9798# Development99npx rsbuild dev # HMR dev server100101# Production build102npx rsbuild build # Optimized production bundle103104# Preview105npx rsbuild preview # Serve production build locally106```107108## Installation109110```bash111npm install -D @rsbuild/core @rsbuild/plugin-react112```113114## Best Practices1151161. **Webpack compatibility** — Reuse existing Webpack loaders via `tools.rspack`; most plugins work without changes1172. **Plugin system** — Use official plugins for React, Vue, Svelte, Sass, Less, TypeScript; composable and fast1183. **Auto code splitting** — `split-by-experience` strategy auto-splits vendor libraries; optimal chunking out of box1194. **Polyfill on demand** — Set `polyfill: "usage"` with browserslist; only includes polyfills for target browsers1205. **Module Federation** — Built-in support for micro-frontends; share components between independently deployed apps1216. **Type checking** — Use `pluginTypeCheck()` for parallel TypeScript checking; doesn't slow down builds1227. **Proxy for API** — Configure dev server proxy; avoid CORS issues during development1238. **5-10x faster** — Rspack (Rust) core provides Webpack semantics at native speed; same configs, faster builds