rsbuild-v2-upgrade

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rsbuild v1 to v2 Upgrade

Rsbuild v1 升级到 v2

Workflow

操作流程

  1. Confirm current setup
    • Read
      package.json
      to identify Rsbuild and plugin packages in use.
    • Locate the Rsbuild config file (commonly
      rsbuild.config.(ts|js|mjs|cjs)
      ).
  2. Open the official upgrade guide
  3. 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.
  4. Update dependencies
    • Bump
      @rsbuild/core
      to v2 (currently Beta tag).
    • Bump Rsbuild plugins to latest versions via
      npx taze major --include /rsbuild/ -w -r
  5. Apply config and code changes
    • Update the Rsbuild config to match v2 options and defaults.
    • Remove deprecated or unsupported settings.
  6. Validate
    • Run the build and dev commands.
    • Run project tests or type checks.
    • Fix any warnings or errors surfaced by the new version.
  1. 确认当前环境配置
    • 查看
      package.json
      文件,识别当前使用的Rsbuild及插件包。
    • 找到Rsbuild配置文件(通常为
      rsbuild.config.(ts|js|mjs|cjs)
      )。
  2. 查阅官方升级指南
  3. 规划升级路径
    • 将当前项目配置与迁移指南进行对比。
    • 列出与项目当前配置和插件相关的破坏性变更。
    • 记录任何已移除或重命名的配置选项、默认值或插件API。
  4. 更新依赖项
    • @rsbuild/core
      升级到v2版本(当前为Beta标签)。
    • 通过
      npx taze major --include /rsbuild/ -w -r
      命令将Rsbuild插件升级到最新版本。
  5. 应用配置与代码变更
    • 更新Rsbuild配置以匹配v2版本的选项和默认值。
    • 移除已废弃或不再支持的配置项。
  6. 验证升级结果
    • 运行构建和开发命令。
    • 执行项目测试或类型检查。
    • 修复新版本中出现的所有警告或错误。