Rspack V2 Upgrade

rstackjs/agent-skills/skills/rspack-v2-upgrade

作者 rstackjs2966acbef746无许可证95 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Use when upgrading a Rspack 1.x project to v2, including dependency and configuration updates.

AI 生成的概览

指导将 Rspack 1.x 项目升级到 v2,涵盖依赖与配置变更。

功能
按六步迁移流程执行:从 package.json 和配置文件确认当前 Rspack 配置,查阅官方迁移指南,梳理适用的破坏性变更,将 Rspack 相关包升级到 v2,应用配置与代码改动,并通过构建、开发、测试或类型检查命令进行验证。产出所需变更清单以及更新且验证通过的项目配置。
适用场景
适用于项目仍在使用 Rspack 1.x 并需要迁移到 v2 的场景,尤其是需要更新依赖、配置选项或插件 API 时。也适合在改动构建配置前先获得一份结构化的破坏性变更清单。
运行要求
除智能体外无需脚本或特殊工具;待升级项目需具备 Rspack 1.x 依赖和 Rspack 配置文件,并需要网络访问以查阅官方迁移指南。

Rspack 1.x to v2 upgrade

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: @rspack/core, @rspack/cli, @rspack/dev-server, @rspack/plugin-react-refresh.
  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.

来源与署名

来源:rstackjs/agent-skills位于skills/rspack-v2-upgrade提交2966acb

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架