rspress-best-practices
Rspress Best Practices
Apply these rules when writing or reviewing Rspress (v2) sites.
Configuration
- Use
rspress.config.tsanddefineConfigfrom@rspress/core - Set
rootexplicitly when docs are not under the defaultdocs/directory - Keep site-wide settings such as
title,description,icon,logo,base, andlangin config instead of repeating them in page files - Prefer first-class Rspress options before custom theme code or low-level bundler overrides
- Keep custom theme code in a top-level
theme/directory and import original theme pieces from@rspress/core/theme-original
CLI
- Use
rspress devfor local development - Use
rspress buildfor production output - Use
rspress previewonly for local preview of the built site - Use
rspress ejectonly when CSS variables, class overrides, or layout wrapping cannot solve the customization
More from rstackjs/agent-skills
rsbuild-best-practices
Rsbuild best practices for config, CLI workflow, type checking, bundle optimization, assets, and debugging. Use when writing, reviewing, or troubleshooting Rsbuild projects.
560rslib-best-practices
Rslib best practices for config, CLI workflow, output, declaration files, dependency handling, build optimization and toolchain integration. Use when writing, reviewing, or troubleshooting Rslib projects.
405rspack-v2-upgrade
Use when upgrading a Rspack 1.x project to v2, including dependency and configuration updates.
236rstest-best-practices
Rstest best practices for config, CLI workflow, test writing, mocking, snapshot testing, DOM testing, coverage, multi-project setup, CI integration, performance and debugging. Use when writing, reviewing, or troubleshooting Rstest test projects.
228rspack-best-practices
Rspack best practices for config, CLI workflow, type checking, CSS, bundle optimization, assets and profiling. Use when writing, reviewing, or troubleshooting Rspack projects.
222rsbuild-v2-upgrade
Use when upgrading a Rsbuild 1.x project to v2, including dependency and configuration updates.
206