
Rsbuild Best Practices
This pulls together the configuration patterns, CLI commands, and optimization techniques you need when working with Rsbuild projects. It covers the practical stuff like when to use `tools.rspack` versus native config options, how to debug with `DEBUG=rsbuild`, and why you should import assets from source directories instead of public. The guidance on type checking with the plugin versus standalone tsc, plus the profiling tips using `RSPACK_PROFILE`, are exactly what you need when things go sideways. It's basically the collected wisdom on staying within Rsbuild's happy path rather than fighting the tool or cargo-culting Webpack patterns.
- skills.sh installs
- 2.8K
- GitHub stars
- 98
- last updated
- Aug 21, 2026
Install
$ npx -y skills add rstackjs/agent-skills --skill rsbuild-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
Rsbuild best practices
Apply these rules when writing or reviewing Rsbuild projects.
Configuration
- Use
rsbuild.config.tsanddefineConfig - Use
tools.rspackortools.bundlerChainonly when no first-class Rsbuild option exists - Define explicit
source.entryvalues for multi-page applications - In TypeScript projects, prefer
tsconfig.jsonpath aliases first
CLI
- Use
rsbuildfor local development - Use
rsbuild buildfor production build - Use
rsbuild previewonly for local production preview - Use
rsbuild inspectto inspect final Rsbuild/Rspack configs
Type checking
- Use
@rsbuild/plugin-type-checkfor integrated dev/build type checks - Or run
tsc --noEmit/vue-tsc --noEmitas an explicit script step
Bundle size optimization
- Prefer dynamic
import()for non-critical code paths - Prefer lightweight libraries where possible
- Keep browserslist aligned with real compatibility requirements
Asset management
- Import source-managed assets from project source directories, not from
public - Reference
publicfiles by absolute URL path
Security
Sponsors
Details
- Repository
- github.com/rstackjs/agent-skills
- Categories
- Documentation, AI & Agent Building, Debugging, Automation & Workflows, CLI & Terminal
- First seen
- May 16, 2026