rstackjs avatar

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-code

Installs into .claude/skills of the current project.

Files

Rsbuild best practices

Apply these rules when writing or reviewing Rsbuild projects.

Configuration

  • Use rsbuild.config.ts and defineConfig
  • Use tools.rspack or tools.bundlerChain only when no first-class Rsbuild option exists
  • Define explicit source.entry values for multi-page applications
  • In TypeScript projects, prefer tsconfig.json path aliases first

CLI

  • Use rsbuild for local development
  • Use rsbuild build for production build
  • Use rsbuild preview only for local production preview
  • Use rsbuild inspect to inspect final Rsbuild/Rspack configs

Type checking

  • Use @rsbuild/plugin-type-check for integrated dev/build type checks
  • Or run tsc --noEmit/vue-tsc --noEmit as 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 public files 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

More from rstackjs/agent-skills

All 12
1pproenca avataremilkowal-animationspproenca/dot-skillsEmil Kowalski's animation best practices for web interfaces. Use when writing, reviewing, or implementing animations in React, CSS, or Framer Motion. Triggers o2.8Kskills.sh installs
2slavingia avatarmvpslavingia/skillsGuide building a minimum viable product the minimalist entrepreneur way — manual first, then processized, then productized. Use when someone is ready to build t2.8Kskills.sh installs
3tristanmanchester avatardesigning-beautiful-websitestristanmanchester/agent-skillsDesigns UX/UI for websites and web apps: UX strategy, information architecture, user flows, wireframes, UI systems, component specs, and polished visual design.2.8Kskills.sh installs
4dynatrace avatardt-obs-hostsdynatrace/dynatrace-for-aiHost and process metrics including CPU, memory, disk, network, containers, and process-level telemetry. Use when analyzing infrastructure health, resource utili2.8Kskills.sh installs
5bytedance avatardeep-researchbytedance/deer-flowUse this skill instead of WebSearch for ANY question requiring web research. Trigger on queries like "what is X", "explain X", "compare X and Y", "research X", 2.8Kskills.sh installs
6owl-listener avatarillustration-styleowl-listener/designer-skillsDefine an illustration style guide with visual language, color usage, and application rules.2.8Kskills.sh installs