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