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 從公開儲存庫中收錄這些內容。

檢舉或申請下架