快速启动开发服务器,轻松构建生产应用。基于 Rsbuild,让 Rspack 的速度贯穿整个开发流程。
$ rs build
Rsbuild v2.0.0
info build started...
ready built in 0.02s
File (web) Size Gzip
dist/static/js/index.js 0.20 kB 0.18 kB
dist/index.html 0.32 kB 0.24 kB
Total: 0.52 kB 0.42 kB使用 Rslib 构建 JavaScript 和 TypeScript 库。从通用工具到组件库,让你的代码在更多项目中复用。
$ rs lib --dts
Rslib v1.0.0
info build started...
ready built in 0.02s
start generating declaration files...
ready declaration files generated
File (esm) Size
dist/index.js 0.04 kB使用 Rstest 运行测试,及时获得代码反馈。复用构建配置,让测试从本地开发顺畅延伸到 CI。
$ rs test
Rstest v0.11.0
✓ src/utils.test.ts (2)
✓ src/app.test.ts (1)
Test Files 2 passed
Tests 3 passed
Duration 211ms一次完成代码检查与格式校验,按需启用 TypeScript 类型检查。兼容 Prettier 的格式化选项与插件,延续现有代码风格。
$ rs check
start Linting...
success Lint passed in 287ms
start Checking formatting...
success Format check passed in 25ms (7 files)在提交前自动检查和格式化暂存文件。支持 lint-staged 的任务配置,可从 Husky 迁移现有 Git Hooks 工作流。
$ rs staged
✔ Done backing up original state!
✔ rs lint --fix
✔ rs fmt
✔ Done running tasks for staged files!
✔ Done staging changes from tasks!
✔ Done cleaning up temporary files!使用 Rspress 将内容构建为文档站点。让文档与代码一同维护,通过统一配置串联完整工作流。
$ rs doc
Rspress v2.0.0
➜ Local: http://localhost:3000/
➜ Network: use --host to expose
start build started...
ready built in 0.18s