rsbuild-v2-upgrade
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRsbuild v1 to v2 Upgrade
Rsbuild v1 升级到 v2
Workflow
操作流程
-
Confirm current setup
- Read to identify Rsbuild and plugin packages in use.
package.json - Locate the Rsbuild config file (commonly ).
rsbuild.config.(ts|js|mjs|cjs)
- Read
-
Open the official upgrade guide
- Use the v1 → v2 guide as the source of truth:
-
Plan the upgrade path
- Compare the current project config with the migration guide.
- List breaking changes that apply to the project’s current config and plugins.
- Note any removed or renamed options, defaults, or plugin APIs.
-
Update dependencies
- Bump to v2 (currently Beta tag).
@rsbuild/core - Bump Rsbuild plugins to latest versions via
npx taze major --include /rsbuild/ -w -r
- Bump
-
Apply config and code changes
- Update the Rsbuild config to match v2 options and defaults.
- Remove deprecated or unsupported settings.
-
Validate
- Run the build and dev commands.
- Run project tests or type checks.
- Fix any warnings or errors surfaced by the new version.
-
确认当前环境配置
- 查看文件,识别当前使用的Rsbuild及插件包。
package.json - 找到Rsbuild配置文件(通常为)。
rsbuild.config.(ts|js|mjs|cjs)
- 查看
-
查阅官方升级指南
- 以v1 → v2官方指南为权威参考:
-
规划升级路径
- 将当前项目配置与迁移指南进行对比。
- 列出与项目当前配置和插件相关的破坏性变更。
- 记录任何已移除或重命名的配置选项、默认值或插件API。
-
更新依赖项
- 将升级到v2版本(当前为Beta标签)。
@rsbuild/core - 通过命令将Rsbuild插件升级到最新版本。
npx taze major --include /rsbuild/ -w -r
- 将
-
应用配置与代码变更
- 更新Rsbuild配置以匹配v2版本的选项和默认值。
- 移除已废弃或不再支持的配置项。
-
验证升级结果
- 运行构建和开发命令。
- 执行项目测试或类型检查。
- 修复新版本中出现的所有警告或错误。