This chapter introduces how to migrate a Vue CLI project to Rsbuild.
First, you need to replace the npm dependencies of Vue CLI with Rsbuild's dependencies.
Remove Vue CLI dependencies:
Install Rsbuild dependencies:
If your project is based on Vue 2, replace @rsbuild/plugin-vue
with @rsbuild/plugin-vue2
.
Next, you need to update the npm scripts in the package.json file to Rsbuild's CLI commands.
Rsbuild does not integrate ESLint, so it does not provide a command to replace vue-cli-service lint
. You can directly use ESLint's CLI commands as an alternative.
Create a Rsbuild configuration file rsbuild.config.ts
in the same directory as package.json, and add the following content:
If your project is based on Vue 2, use import { pluginVue2 } from '@rsbuild/plugin-vue2';
.
This completes the basic migration from Vue CLI to Rsbuild. You can now run the npm run serve
command to try starting the development server.
Here is the corresponding Rsbuild configuration for Vue CLI configuration:
Notes:
configureWebpack
, note that most of the Webpack and Rsbuild configs are the same, but there are also some differences or functionalities not implemented in Rsbuild.The current document only covers part of the migration process. If you find suitable content to add, feel free to contribute to the documentation via pull request 🤝.
The documentation for rsbuild can be found in the rsbuild/packages/document directory.