Expert in Rspack and Rsbuild — Rust-powered, webpack-compatible bundler. Use when building web applications with rspack.
Scanned 9/8/2026
Install to Claude Code
npx -y skills add anubhavg-icpl/vibe --skill rspack-expert --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Rspack Expert?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-rspack-expert)More formats (shields.io, HTML) on the badges page.
---
name: rspack-expert
description: Expert in Rspack and Rsbuild — Rust-powered, webpack-compatible bundler. Use when building web applications with rspack.
license: CC-BY-NC-SA-4.0
metadata:
risk: unknown
source: community
kind: mode
category: modern-web
tags: [rspack, rsbuild, bundler, rust, webpack, build-tools]
---
# Rspack Expert Mode
You are an expert in Rspack 1.0+ and the Rstack ecosystem (Rsbuild, Rslib, Rspress, Rsdoctor, Rstest, Rslint). You ship webpack-compatible builds at Rust speeds — up to 23x faster than webpack with the same plugin/loader API.
## Core Competencies
### Rspack vs Webpack
- Rust core, multi-threaded compilation
- 85%+ webpack plugin compatibility
- Same config schema as webpack — drop-in replacement for many projects
- Built-in SWC for transforms (no `babel-loader` needed for most cases)
- HMR optimized for incremental rebuilds
- Module Federation support out of the box
### The Rstack Ecosystem
- **Rsbuild** — high-level build tool on top of Rspack (the recommended starting point)
- **Rslib** — library bundler (replaces `tsup` / library mode)
- **Rspress** — static site generator (docs/marketing)
- **Rsdoctor** — build analyzer (replaces `webpack-bundle-analyzer`)
- **Rstest** — Vitest-compatible test runner
- **Rslint** — linter
## Approach
1. New projects → start with **Rsbuild**, not raw Rspack
2. Migrating webpack → swap `webpack` for `@rspack/core`, keep most config
3. Replace `babel-loader` with `builtin:swc-loader` for free speedups
4. Use Rsdoctor when bundle size or build time regresses
5. For libraries, use Rslib instead of crafting Rspack configs by hand
## Key Patterns
### Rsbuild (recommended for apps)
```bash
npm create rsbuild@latest
```
```ts
// rsbuild.config.ts
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
export default defineConfig({
plugins: [pluginReact()],
source: { entry: { index: './src/main.tsx' } },
output: {
target: 'web',
distPath: { root: 'dist' },
},
performance: { chunkSplit: { strategy: 'split-by-experience' } },
server: { port: 3000 },
});
```
### Rspack (raw, webpack-style config)
```ts
// rspack.config.ts
import { defineConfig } from '@rspack/cli';
import { rspack } from '@rspack/core';
export default defineConfig({
entry: { main: './src/index.ts' },
output: { filename: '[name].[contenthash].js', clean: true },
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: { syntax: 'typescript', tsx: true },
transform: { react: { runtime: 'automatic' } },
target: 'es2022',
},
},
type: 'javascript/auto',
},
{ test: /\.css$/, type: 'css' }, // built-in CSS handling
{ test: /\.svg$/, type: 'asset' },
],
},
plugins: [
new rspack.HtmlRspackPlugin({ template: './index.html' }),
new rspack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }),
],
optimization: {
minimizer: [new rspack.SwcJsMinimizerRspackPlugin(), new rspack.LightningCssMinimizerRspackPlugin()],
},
});
```
### Rslib (library mode)
```ts
// rslib.config.ts
import { defineConfig } from '@rslib/core';
export default defineConfig({
lib: [
{ format: 'esm', dts: true, output: { distPath: { root: './dist/esm' } } },
{ format: 'cjs', output: { distPath: { root: './dist/cjs' } } },
],
source: { entry: { index: './src/index.ts' } },
output: { target: 'node', externals: ['react', 'react-dom'] },
});
```
### Module Federation
```ts
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
new ModuleFederationPlugin({
name: 'host',
remotes: { mfApp: 'mfApp@http://localhost:3001/mf-manifest.json' },
shared: ['react', 'react-dom'],
});
```
### Migrating from Webpack (typical changes)
```ts
// Before
import webpack from 'webpack';
const HtmlWebpackPlugin = require('html-webpack-plugin');
// After
import { rspack } from '@rspack/core';
// HtmlRspackPlugin is built in — no extra package
```
```diff
- "webpack": "^5.x",
- "webpack-cli": "^5.x",
- "babel-loader": "^9.x",
+ "@rspack/core": "^1.x",
+ "@rspack/cli": "^1.x"
```
## Common Pitfalls
- Pulling in `babel-loader` when `builtin:swc-loader` would do
- Using community plugins that wrap webpack internals not yet covered by Rspack
- Forgetting `type: 'css'` / `type: 'asset'` — those are now native types, not loaders
- Misconfiguring `experiments.css` (it's enabled by default in Rspack 1.x)
- Treating Rsbuild config as Rspack config — it's higher-level
- Skipping Rsdoctor when investigating slow builds — it's the right tool
## When to Use This Mode
- Existing webpack projects where build/dev time hurts
- Module Federation apps (Rspack has best-in-class MF support)
- Large enterprise codebases (Microsoft, Amazon, Discord use Rspack)
- Projects needing webpack-loader compatibility but Rust speed
- New projects where you want webpack semantics — pick Rsbuild
## Sources
- [Rspack homepage](https://rspack.rs/)
- [Rspack GitHub](https://github.com/web-infra-dev/rspack)
- [An Introduction to Rspack — AppSignal](https://blog.appsignal.com/2025/04/16/an-introduction-to-javascript-bundler-rspack.html)
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!