The React plugin provides support for React features. The plugin internally integrates features such as React Refresh.
You can install the plugin using the following command:
You can register the plugin in the rsbuild.config.ts
file:
After registering the plugin, you can directly develop React.
The on-demand import capability of the React component library comes from source.transformImport.
When the Ant Design component library <= 4.x version is installed in the project, Rsbuild will automatically add on-demand import capabilities, and the default configuration is as follows:
When the Arco Design component library is installed in the project, Rsbuild will automatically add on-demand import capabilities, and the default configuration is as follows:
When you add configurations for antd
or @arco-design/web-react
in source.transformImport, the priority will be higher than the default configurations mentioned above.
At the same time, the above default behavior can be turned off by manually setting transformImport: false
.