rspack-v2-upgrade
$
npx mdskill add rstackjs/agent-skills/rspack-v2-upgradeUpgrade Rspack 1.x projects to v2 by managing dependency and configuration updates.
- Resolves issues encountered when migrating an existing Rspack build setup to the latest major version.
- Interacts with `package.json` and Rspack configuration files to analyze the current build structure.
- Determines necessary code and dependency modifications by cross-referencing project settings with official migration documentation.
- Outputs a step-by-step plan detailing required dependency upgrades and configuration adjustments for validation.
SKILL.md
.github/skills/rspack-v2-upgradeView on GitHub ↗
---
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 `rc` 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.
More from rstackjs/agent-skills
- migrate-to-rsbuildMigrate webpack, Vite, create-react-app (CRA/CRACO), or Vue CLI projects to Rsbuild.
- migrate-to-rslibMigrate tsc or tsup library projects to Rslib.
- migrate-to-rstestMigrate Jest or Vitest test suites and configs to Rstest. Use when asked to move from Jest/Vitest to Rstest, replace framework APIs with `@rstest/core`, translate test config to `rstest.config.ts`, or update test scripts and setup files for Rstest equivalents.
- pr-creatorUse when asked to create a pull request for this repository. It helps the PR follow the repository's branch safety rules, title convention, pull request template, and concise English writing style.
- rsbuild-best-practicesRsbuild best practices for config, CLI workflow, type checking, bundle optimization, assets, and debugging. Use when writing, reviewing, or troubleshooting Rsbuild projects.
- rsbuild-v2-upgradeUse when upgrading a Rsbuild 1.x project to v2, including dependency and configuration updates.
- rsdoctor-analysisUse when analyzing Rspack/Webpack bundles from local `rsdoctor-data.json` and producing evidence-based optimization recommendations.
- rslib-best-practicesRslib best practices for config, CLI workflow, output, declaration files, dependency handling, build optimization and toolchain integration. Use when writing, reviewing, or troubleshooting Rslib projects.
- rspack-best-practicesRspack best practices for config, CLI workflow, type checking, CSS, bundle optimization, assets and profiling. Use when writing, reviewing, or troubleshooting Rspack projects.
- rspack-debuggingHelps Rspack users and developers debug crashes or deadlocks/hangs in the Rspack build process using LLDB. Use this Skill when users encounter "Segmentation fault" errors during Rspack builds or when the build progress gets stuck.