Solid
How to use
There are two ways to use Solid with Rspack:
- Use Rsbuild to start a Solid project with JSX compilation and hot module replacement (HMR) already configured. Follow the Rsbuild guide for Solid.
- Configure Rspack manually to add Solid to your own Rspack configuration. Follow the steps below or start from the Rspack + Solid example.
Configure Solid
Solid components are commonly written in JSX or TSX. solid-loader lets Rspack compile those components with Solid's native compiler.
The loader requires Rspack 2.0.0 or later and Solid 2.0.0 or later. For an existing Solid 1 project, see Solid v1.
Compile JSX and TSX
Install solid-loader as a development dependency.
Add a rule for JavaScript and TypeScript files. In this rule, solid-loader handles JSX and TSX, and builtin:swc-loader removes TypeScript types.
Configure TypeScript
For Solid JSX type checking and editor completions, add these options to your tsconfig.json. Rspack compiles JSX and TSX using the loader rule above.
Resolve Solid libraries
Some Solid component libraries publish their JSX source under the solid condition in their package exports. Add 'solid' to resolve.conditionNames so Rspack can select that source and compile it with the rule above. The '...' entry keeps Rspack's default conditions.
Load hydration modules
When Solid makes a server-rendered page interactive, its web runtime (@solidjs/web) can load additional modules. The server supplies their URLs, and the browser loads them with import(url).
Add the following rule to module.rules. It sets parser.importDynamic to false for @solidjs/web so Rspack preserves the runtime's native import() calls.
Solid v1
For a Solid 1 project, use babel-loader with babel-preset-solid to compile JSX and solid-refresh for hot updates. The Solid v1 example shows the complete Rspack configuration. If you use Rsbuild, follow the Rsbuild guide for Solid v1.

