rspack-v2-upgrade

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rspack 1.x to v2 Upgrade

Rspack 1.x 升级至 v2 版本

Workflow

操作流程

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