Modern.js Builder
This chapter introduces how to migrate a Modern.js Builder (or EdenX Builder) project to Rsbuild.
Key differences
Rsbuild is the new version of Modern.js Builder, with the following key differences:
- Rsbuild has better performance. When using Rspack simultaneously, the startup speed and build speed of Rsbuild are 1.5 to 2 times faster than Builder.
- Rsbuild only supports Rspack as the bundler and no longer supports webpack.
- Rsbuild's CLI tool and dev server are more powerful and support more features.
Installing dependencies
First, you need to replace the npm dependencies related to Builder with Rsbuild's dependencies.
- Remove Builder's dependencies:
- Install Rsbuild's dependencies:
Updating npm scripts
Next, you need to update the npm scripts in the package.json to Rsbuild's CLI commands.
Modifying configuration files
- Rename
builder.config.tstorsbuild.config.ts. - Change the import of the
defineConfigmethod from@modern-js/builder-clito@rsbuild/core. - Change the
builderPluginsfield toplugins.
Replacing plugins
Rsbuild and Builder have incompatible plugin systems, so you need to replace Builder's plugins with Rsbuild's plugins.
The following table shows the correspondence between Builder plugins and Rsbuild plugins:
For example, if you were using @modern-js/builder-plugin-vue, you need to first install @rsbuild/plugin-vue, then import the plugin in rsbuild.config.ts and add it to the plugins field.
Add React-related plugins
Rsbuild is not coupled with any front-end UI framework. Therefore, if you are a React project, you need to manually add React Plugin:
If you are using SVGR in your current project, you also need to register SVGR Plugin:
If you are a user of other frameworks, you can refer to Rsbuild Plugin List to select the corresponding framework plugin.
Config migration
Most configs in Rsbuild and Builder are consistent, with only a few adjustments.
You can refer to the Rsbuild options to view the configs of Rsbuild.
It is worth noting that, compared to Builder, there are some differences in default values and behaviors in Rsbuild:
- Browserslist: The default is minimum compatible with browsers that support Native ES Modules, refer to Default Browserslist.
- HTML file output path: default output to the root of the dist directory, refer to Default Directory Structure.
- Polyfill injection method: Inject on demand by default, refer to output.polyfill.
- TypeScript type check: not enabled by default, you need to manually register the @rsbuild/plugin-type-check.
- Modify DevServer configuration: Modify
devandserverconfiguration instead.
Validating results
After completing the above steps, you have migrated from Modern.js Builder to Rsbuild. You can now try starting the dev server by running the npm run dev command.
If you encounter any issues during the build process, please debug according to the error logs.
Contents supplement
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/website directory.

