Solid plugin
The Solid plugin provides support for Solid features. The plugin internally integrates babel-preset-solid.
The Solid plugin relies on Babel transpilation and requires an additional Babel Plugin. At the same time, adding the Babel plugin will cause additional compilation overhead.
Quick start
Install plugin
You can install the plugin using the following command:
Register plugin
You can register the plugin in the rsbuild.config.ts file:
After registering the plugin, you can directly develop Solid.
Since the Solid JSX relies on Babel for compilation, you need to additionally add the Babel plugin.
Babel compilation will introduce extra overhead, in the example above, we use include to match .jsx and .tsx files, thereby reducing the performance cost brought by Babel.
Resolution behavior
The Solid plugin adds solid to Rsbuild's resolve.conditionNames. This allows package exports to resolve Solid-specific entries when they are available.
In development mode, the plugin also adds development to resolve Solid's development runtime. You can disable this behavior with dev: false.
If you configure resolve.conditionNames, the plugin preserves your configured values and prepends these Solid conditions.
Options
To customize the compilation behavior of Solid, use the following options.
dev
Whether to resolve Solid's development runtime in development mode. Set it to false to disable the development condition, or set it to true to force the development condition in production mode.
- Type:
boolean - Default:
truein development mode,falsein production mode - Example:
refresh.disabled
Whether to disable Solid Refresh for HMR in development mode. This only controls Solid Refresh injection and does not disable Rsbuild HMR.
- Type:
boolean - Default:
false - Example:
ssr
Whether to generate output for Solid SSR. When enabled, the plugin uses generate: 'ssr' and hydratable: true for Node.js targets, and uses generate: 'dom' and hydratable: true for other targets.
Values in solid will override these defaults.
- Type:
boolean - Default:
false - Example:
solid
These options are passed to babel-preset-solid. For details, see the babel-preset-solid documentation.
- Type:
SolidPresetOptions - Default:
{} - Example:
solidPresetOptionsis a deprecated alias forsolid. Usesolidinstead. If both options are set,solidtakes precedence.

