$npx -y skills add rstackjs/agent-skills --skill rspack-v2-upgradeUse when upgrading a Rspack 1.x project to v2, including dependency and configuration updates.
| 1 | # Rspack 1.x to v2 Upgrade |
| 2 | |
| 3 | ## Workflow |
| 4 | |
| 5 | 1. **Confirm current setup** |
| 6 | - Read `package.json` to identify Rspack packages in use. |
| 7 | - Locate the Rspack config file (commonly `rspack.config.(ts|js|mjs|cjs)`). |
| 8 | |
| 9 | 2. **Open the official migration guide** |
| 10 | - Use the official guide as the single source of truth: |
| 11 | - https://rspack.rs/guide/migration/rspack_1.x |
| 12 | |
| 13 | 3. **Plan required changes** |
| 14 | - Compare the current project config with the migration guide. |
| 15 | - List breaking changes that apply to the project’s current config and plugins. |
| 16 | - Note any removed or renamed options, defaults, or plugin APIs. |
| 17 | |
| 18 | 4. **Update dependencies** |
| 19 | - Upgrade Rspack packages to v2: `@rspack/core`, `@rspack/cli`, `@rspack/dev-server`, `@rspack/plugin-react-refresh`. |
| 20 | |
| 21 | 5. **Apply migration changes** |
| 22 | - Update the Rspack config and related code according to the official guide. |
| 23 | - Remove deprecated or unsupported options. |
| 24 | |
| 25 | 6. **Validate** |
| 26 | - Run build and dev commands. |
| 27 | - Run project tests or type checks. |
| 28 | - Fix any warnings or errors surfaced by the new version. |