$npx -y skills add rstackjs/agent-skills --skill migrate-to-rsbuildMigrate webpack, Vite, create-react-app (CRA/CRACO), or Vue CLI projects to Rsbuild.
| 1 | # Migrate to Rsbuild |
| 2 | |
| 3 | ## Goal |
| 4 | |
| 5 | Migrate webpack, Vite, create-react-app (CRA/CRACO), or Vue CLI projects to Rsbuild with minimal behavior changes and clear verification. |
| 6 | |
| 7 | ## Supported source frameworks |
| 8 | |
| 9 | - webpack |
| 10 | - Vite |
| 11 | - CRA / CRACO |
| 12 | - Vue CLI |
| 13 | |
| 14 | ## Migration principles (must follow) |
| 15 | |
| 16 | 1. **Official guide first**: treat Rsbuild migration docs as source of truth. |
| 17 | 2. **Smallest-change-first**: complete baseline migration first, then migrate custom behavior. |
| 18 | 3. **Do not change business logic**: avoid touching app runtime code unless user explicitly asks. |
| 19 | 4. **Validate before cleanup**: keep old tool dependencies/config temporarily if needed; remove only after Rsbuild is green. |
| 20 | |
| 21 | ## Workflow |
| 22 | |
| 23 | 1. **Detect source framework** |
| 24 | - Check `package.json` dependencies/scripts and config files: |
| 25 | - webpack: `webpack.config.*` |
| 26 | - Vite: `vite.config.*` |
| 27 | - CRA/CRACO: `react-scripts`, `@craco/craco`, `craco.config.*` |
| 28 | - Vue CLI: `@vue/cli-service`, `vue.config.*` |
| 29 | |
| 30 | 2. **Apply framework-specific deltas** |
| 31 | - webpack: `references/webpack.md` |
| 32 | - Vite: `references/vite.md` |
| 33 | - CRA/CRACO: `references/cra.md` |
| 34 | - Vue CLI: `references/vue-cli.md` |
| 35 | |
| 36 | 3. **Validate behavior** |
| 37 | - Run dev server to verify the project starts without errors. |
| 38 | - Run build command to verify the project builds successfully. |
| 39 | - If issues remain, compare the old project configuration with the migration guide and complete any missing mappings. |
| 40 | |
| 41 | 4. **Cleanup and summarize** |
| 42 | - Remove obsolete dependencies/config only after validation passes. |
| 43 | - Summarize changed files and any remaining manual follow-ups. |