home / skills / rstackjs / agent-skills / rspack-v2-upgrade
This skill helps upgrade a Rspack 1.x project to v2 by guiding dependency updates, config changes, and validation against the official migration guide.
npx playbooks add skill rstackjs/agent-skills --skill rspack-v2-upgradeReview the files below or copy the command above to add this skill to your agents.
---
name: rspack-v2-upgrade
description: Use when upgrading a Rspack 1.x project to v2, including dependency and configuration updates.
---
# 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**
- Use the official guide as the single source of truth:
- https://v2.rspack.rs/guide/migration/rspack_1.x
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 (currently Beta tag): `@rspack/core`, `@rspack/cli`, `@rspack/dev-server`.
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.
This skill guides upgrading a Rspack 1.x project to Rspack v2, covering dependency changes and configuration updates. It consolidates the migration workflow, points to the official migration guide as the source of truth, and helps validate the result with build and test checks. Use it to reduce upgrade risk and uncover breaking changes early.
The skill inspects package.json and locates the project Rspack configuration file (rspack.config.(ts|js|mjs|cjs)). It compares current config and plugins against the official Rspack v2 migration notes, recommends dependency updates for @rspack/core, @rspack/cli and @rspack/dev-server, and produces a checklist of required config edits. Finally, it guides running builds, dev server, and tests to validate the migration and surface remaining issues.
Do I need to update all Rspack packages at once?
Update core packages together (@rspack/core, @rspack/cli, @rspack/dev-server) to match v2; staggered updates can cause incompatibilities.
Where should I look for breaking change details?
Use the official Rspack v2 migration guide as the definitive reference and compare your current config to the examples there.