Provides shared Rsbuild configs for web applications: defineDevConfig, defineBuildConfig, defineStorybookConfig, and RsbuildConfigTransformer. Use when setting up dev server, production builds, Storybook, SVG/CSS Modules type declarations, Turborepo tasks, upgrading to Rsbuild 2, or migrating from @workleap/webpack-configs.
Ships in wl-web-configs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
@workleap/rsbuild-configs provides Rsbuild configurations for web applications. Rsbuild is a high-performance bundler powered by Rspack (Rust-based webpack port).
Features: JavaScript, TypeScript, CSS (modules + LightningCSS), React, SVG as components, PNG/JPEG/GIF, HMR/Fast Refresh, source maps, minification.
Target environment: As per Browserslist configuration.
| Function | Use Case |
|---|---|
defineDevConfig | Development server |
defineBuildConfig | Production build |
defineStorybookConfig | Storybook integration |
pnpm add -D @workleap/rsbuild-configs @workleap/browserslist-config @rsbuild/core @rspack/core browserslist
For Storybook, also add:
pnpm add -D storybook-react-rsbuild
Create public/index.html:
<!DOCTYPE html>
<html>
<head>
<link href="<%=assetPrefix%>/favicon.png" rel="icon">
</head>
<body>
<div id="root"></div>
</body>
</html>
Create .browserslistrc:
extends @workleap/browserslist-config
// rsbuild.dev.ts
import { defineDevConfig } from "@workleap/rsbuild-configs";
export default defineDevConfig();
| Option | Type | Default | Description |
|---|---|---|---|
entry | object | { index: "./src/index.tsx" } | Entry points |
https | boolean/function/object | false | Enable HTTPS. true generates a self-signed certificate via rsbuild-plugin-basic-ssl; pass a (defaultOptions: PluginBasicSslOptions) => PluginBasicSslOptions function to customize it, or an object to set a certificate manually |
host | string | localhost | Dev server host |
port | number | 8080 | Dev server port |
assetPrefix | string | / | Asset URL prefix |
plugins | array | [] | Rsbuild plugins |
html | false/function | default template | HTML template config |
lazyCompilation | boolean | false | Enable lazy compilation |
hmr | boolean | true | Enable HMR |
fastRefresh | boolean | true | Enable Fast Refresh |
sourceMap | false/object | { js: "cheap-module-source-map", css: true } | Source maps |
overlay | false | undefined | Error overlay |
writeToDisk | true | undefined | Write output to disk |
setup | function/array | undefined | server.setup hook for custom middleware |
react | false/function | enabled | React transformation |
svgr | false/function | enabled | SVG as React components |
verbose | boolean | false | Verbose logging |
environmentVariables | object | {} | App environment variables |
HTTPS with custom port:
export default defineDevConfig({
https: true,
port: 3000
});
Custom entry:
export default defineDevConfig({
entry: { index: "./src/main.tsx" }
});
Environment variables:
export default defineDevConfig({
environmentVariables: {
"DEBUG": process.env.DEBUG === "true"
}
});
Disable React transformation:
export default defineDevConfig({
react: false
});
Custom dev-server middleware via setup:
export default defineDevConfig({
setup: ({ server, action }) => {
if (action === "dev") {
server.middlewares.use((req, res, next) => {
next();
});
}
}
});
// rsbuild.build.ts
import { defineBuildConfig } from "@workleap/rsbuild-configs";
export default defineBuildConfig();
| Option | Type | Default | Description |
|---|---|---|---|
entry | object | { index: "./src/index.tsx" } | Entry points |
distPath | object | { root: "./dist" } | Output directory (Rsbuild output.distPath) |
assetPrefix | string | / | Asset URL prefix |
plugins | array | [] | Rsbuild plugins |
html | false/function | default template | HTML template config |
minify | false/object | true | Code minification |
optimize | boolean/"readable" | true | Production optimization |
sourceMap | false/object | { js: "source-map", css: true } | Source maps |
polyfill | "entry"/"usage"/"off" | "usage" | output.polyfill mode (core-js polyfills) |
splitChunks | object/false | { preset: "per-package", chunks: "all" } | splitChunks strategy |
react | false/function | enabled | React transformation |
svgr | false/function | enabled | SVG as React components |
compressImage | false/function | enabled | Image compression |
verbose | boolean | false | Verbose logging |
environmentVariables | object | {} | App environment variables |
Custom output path:
import path from "node:path";
export default defineBuildConfig({
distPath: { root: path.resolve("./build") }
});
Disable minification (debugging):
export default defineBuildConfig({
minify: false
});
Readable output (debugging):
export default defineBuildConfig({
optimize: "readable"
});
Disable polyfills:
export default defineBuildConfig({
polyfill: "off"
});
Opt out of code splitting (restores v1 behavior):
export default defineBuildConfig({
splitChunks: false
});
Customize the split-chunks strategy:
export default defineBuildConfig({
splitChunks: {
preset: "single-vendor",
chunks: "all"
}
});
// .storybook/rsbuild.config.ts
import { defineStorybookConfig } from "@workleap/rsbuild-configs";
export default defineStorybookConfig();
// .storybook/main.ts
import type { StorybookConfig } from "storybook-react-rsbuild";
const storybookConfig: StorybookConfig = {
framework: "storybook-react-rsbuild",
// Relative to the ".storybook" folder, adjust to where the stories are located.
stories: ["../../src/**/*.stories.(tsx|mdx)"]
};
export default storybookConfig;
| Option | Type | Default |
|---|---|---|
plugins | array | [] |
lazyCompilation | boolean | true |
sourceMap | false/object | { js: "cheap-module-source-map", css: true } |
react | false/function | enabled |
svgr | false/function | enabled |
verbose | boolean | false |
environmentVariables | object | {} |
For full control, use transformers:
import { defineDevConfig, type RsbuildConfigTransformer } from "@workleap/rsbuild-configs";
import type { RsbuildConfig } from "@rsbuild/core";
const customTransformer: RsbuildConfigTransformer = (config: RsbuildConfig, context) => {
if (context.environment === "dev") {
config.tools = config.tools ?? {};
// modify config
}
return config;
};
export default defineDevConfig({
transformers: [customTransformer]
});
Context properties: environment ("dev" | "build" | "storybook"), verbose (boolean)
{ "dev": "rsbuild dev --config ./rsbuild.dev.ts" }
{ "build": "rsbuild build --config rsbuild.build.ts" }
{
"dev": "storybook dev -p 6006",
"build": "storybook build"
}
Create src/env.d.ts:
declare module '*.svg' {
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
}
declare module '*.svg?react' {
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
export default ReactComponent;
}
// src/env.d.ts
/// <reference types="@rsbuild/core/types" />
For monorepos, include env.d.ts from dependencies:
// tsconfig.json
{
"include": [".", "../**/src/env.d.ts"]
}
import { ReactComponent as Logo } from "./logo.svg";
export const App = () => <Logo />;
{
"$schema": "https://turbo.build/schema.json",
"ui": "tui",
"tasks": {
"dev": {
"dependsOn": ["^build"],
"cache": false,
"persistent": true
},
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", "storybook-static/**"]
}
}
}
{
"dev-app": "turbo run dev --filter=./apps/app",
"build-app": "turbo run build --filter=./apps/app"
}
No specific deployment setup is recommended, but SPAs must serve index.html for direct URL access (refresh / deep links) instead of returning a 404. Add a _redirects file to the public folder — Rspack copies it into dist at build time:
# public/_redirects
/* /index.html 200
@workleap/rsbuild-configs v4.0 upgrades to Rsbuild 2.0 / Rspack 2.0.
20.19+ or 22.12+ required (Node.js 18 is no longer supported).pnpm add -D @workleap/rsbuild-configs@^4.0.0 @rsbuild/core@^2.0.0 @rspack/core@^2.0.0core-js is now a direct dependency of @workleap/rsbuild-configs; you can pnpm remove core-js from the app. The polyfill option defaults to "usage".@rsbuild/core is now pure ESM — import it from ESM files.pnpm add -D @module-federation/runtime-tools (no longer transitive via @rsbuild/core).@workleap/webpack-configs to @workleap/rsbuild-configsdefine*Config functions are thin wrappers; use a transformer for anything the predefined options don't cover@workleap/rslib-configs for libraries.browserslistrc extending @workleap/browserslist-config in the application@workleap/webpack-configs for new and existing applicationsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/wl-web-configs:workleap-rsbuild-configsfrom wl-web-configs
npx claudepluginhub workleap/wl-web-configs --plugin wl-web-configs10 skills in this plugin
/workleap-browserslist-configWorkleap's shared Browserslist config (`@workleap/browserslist-config`). Use when adding or customizing a `.browserslistrc` in a project that uses `@workleap/browserslist-config`, adding custom browser targets, listing the supported browser versions, or deciding whether a project (application vs library) should include Browserslist at all.
/workleap-chromatic-best-practicesWorkleap's Chromatic best practices for snapshot cost control and CI optimization. Use when auditing, setting up, or fixing Chromatic configurations — including TurboSnap-disabling patterns, CI workflows, chromatic.config.json, and monorepo setups. Also activate when reviewing PRs that touch Storybook or Chromatic-related files.
/workleap-react-best-practicesReact performance optimization guidelines for Single Page Applications (SPA) at Workleap. Use when writing, reviewing, or refactoring React SPA code. Covers async waterfall elimination, bundle size reduction, re-render optimization, rendering efficiency, JS micro-optimizations, and advanced patterns. Activate even for small component changes — performance regressions compound silently. Does not cover SSR, Next.js, or server components./workleap-rslib-configsWorkleap's shared Rslib configs for libraries (`@workleap/rslib-configs`): `defineBuildConfig`, `defineDevConfig`, `defineStorybookConfig`, and `RslibConfigTransformer`. Use when setting up, customizing, or troubleshooting the build, watch mode, or Storybook of a library that uses `@workleap/rslib-configs`, choosing bundleless vs bundle output, configuring `tsconfig.build.json` or type declarations, upgrading to Rslib 2, or migrating a library from `@workleap/tsup-configs`.
/workleap-skill-optimizerOptimize agent skills to reduce context bloat while preserving answer coverage. Use when a skill's body exceeds ~250 lines, duplicates its references, has a verbose description, or triggers false positives. Also activate proactively when reviewing any skill with both a body and reference files.
/workleap-skill-safety-reviewEvaluate third-party agent skills for security risks before adoption or update. Use when installing, updating, or auditing skills from any source (skills.sh, ClawHub, public registries, PRs). Also activate when building allowlists, investigating suspicious behavior, or answering "is this skill safe?"