$npx -y skills add rstackjs/agent-skills --skill rsbuild-v2-upgradeUse when upgrading a Rsbuild 1.x project to v2, including dependency and configuration updates.
| 1 | # Rsbuild v1 to v2 Upgrade |
| 2 | |
| 3 | ## Workflow |
| 4 | |
| 5 | 1. **Confirm current setup** |
| 6 | - Read `package.json` to identify Rsbuild and plugin packages in use. |
| 7 | - Locate the Rsbuild config file (commonly `rsbuild.config.(ts|js|mjs|cjs)`). |
| 8 | |
| 9 | 2. **Open the official upgrade guide** |
| 10 | - Use the v1 → v2 guide as the source of truth: |
| 11 | - https://rsbuild.rs/guide/upgrade/v1-to-v2 |
| 12 | |
| 13 | 3. **Plan the upgrade path** |
| 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 | - Bump `@rsbuild/core` to v2 |
| 20 | - Bump Rsbuild plugins to latest versions via `npx taze major --include /rsbuild/ -w -r` |
| 21 | |
| 22 | 5. **Apply config and code changes** |
| 23 | - Update the Rsbuild config to match v2 options and defaults. |
| 24 | - Remove deprecated or unsupported settings. |
| 25 | |
| 26 | 6. **Validate** |
| 27 | - Run the build and dev commands. |
| 28 | - Run project tests or type checks. |
| 29 | - Fix any warnings or errors surfaced by the new version. |