Rspack Best Practices
Opinionated checklist for configuring, reviewing, and troubleshooting Rspack builds across config, CSS, assets, and profiling.
- CCM score
- 56 of 100
- skills.sh installs
- 722
- GitHub stars
- 101
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers Rspack configuration with
rspack.config.tsanddefineConfig, plus narrow rule conditions and built-in plugin preferences - Includes CLI workflow guidance for
rspack dev,rspack build, andrspack preview, plus type checking viats-checker-rspack-pluginortsc --noEmit - Enforces one CSS strategy (built-in CSS,
css-loaderwithCssExtractRspackPlugin, orstyle-loader) and asset modules over legacyfile-loaderandurl-loader - Designed for reviewing and troubleshooting Rspack projects, with profiling via
--cpu-profandRSPACK_PROFILE=OVERVIEWand a security rule against publishing source maps
Install
$ npx -y skills add rstackjs/agent-skills --skill rspack-best-practices -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Rspack best practices
Apply these rules when writing or reviewing Rspack projects.
Configuration
- Use
rspack.config.tsanddefineConfig - Define explicit
entryvalues for multi-page applications - Keep one main config and branch by
process.env.NODE_ENVonly when needed - Keep rule conditions narrow and explicit (
test,include,exclude,resourceQuery) - Prefer built-in Rspack plugins/loaders over community JS alternatives when equivalent features exist
CLI
If @rspack/cli is installed:
- Use
rspack devfor local development - Use
rspack buildfor production build - Use
rspack previewonly for local production preview
Type checking
- Use
ts-checker-rspack-pluginfor integrated dev/build type checks - Or run
tsc --noEmit/vue-tsc --noEmitas an explicit script step
CSS
Choose one strategy:
- Built-in CSS (
type: 'css' | 'css/auto' | 'css/module') for modern setups css-loader+CssExtractRspackPluginfor webpack migration compatibilitystyle-loaderfor pure style-in-JS runtime injection scenarios
Optional:
Details
- Repository
- github.com/rstackjs/agent-skills
- Category
- Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What does the rspack-best-practices skill do?
The rspack-best-practices skill gives agents rules for writing, reviewing, or troubleshooting Rspack builds. It covers config with rspack.config.ts, CSS strategy, asset modules, type checking, bundle size, and profiling.
How do I install the rspack-best-practices skill?
Run npx -y skills add rstackjs/agent-skills --skill rspack-best-practices -y in your project. Once installed, rspack-best-practices guides the agent through Rspack configuration and build workflow decisions.
Where does rspack-best-practices stand in Frontend & UI Code?
The rspack-best-practices skill is listed in the Frontend & UI Code category alongside vercel-react-best-practices, web-design-guidelines, and design-taste-frontend. It focuses narrowly on Rspack build tooling rather than general UI design.
Who should use the rspack-best-practices skill?
Developers working on Rspack projects who want an agent to follow established practices benefit most from rspack-best-practices. It helps with multi-page entries, narrow loader rules, and choosing between CSS strategies.
Does rspack-best-practices require any tools or accounts?
The skill's SKILL.md lists no accounts or API keys, but Rspack CLI commands assume @rspack/cli is installed in the project. Profiling steps use Node CPU profiling and RSPACK_PROFILE tracing.
More from rstackjs/agent-skills
All 12Similar to Rspack Best Practices
More Frontend & UI Codersbuild-best-practicesSkillrstackjs/agent-skills3K installsBest-practices guide for writing, reviewing, and troubleshooting Rsbuild config, CLI use, type checks, and bundle size.
rspack-tracingSkillrstackjs/agent-skills303 installsDiagnostic toolkit for Rspack build traces that locates crashes, slow phases, and costly plugins or loaders.
webpack-bundlerSkillmindrally/skills857 installsBest practices for configuring, optimizing, and debugging Webpack 5 bundles across development and production.
react-vite-best-practicesSkillasyrafhussin/agent-skills3.1K installsCurated performance rules for React and Vite covering build tuning, code splitting, dev startup, and asset handling.
typescriptSkillpproenca/dot-skills1.8K installsTypeScript performance guide covering 45 rules for tsconfig, type errors, async patterns, and modules, prioritized by impact.
Front-End ChecklistMCP serverthedaviddias74.9K starsAudit frontend code and live pages against 386 web development rules via structured review tools.