Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ export default {

### solid

Pass options to the selected Solid compiler through `solid`. It generates DOM output by default and enables development transforms in Rspack’s development mode. For a server build that renders HTML for hydration, use the following settings.
Pass options to the selected Solid compiler through `solid`. It generates DOM output by default and enables development transforms in Rspack’s development mode. Source locations are relative to Rspack’s `context` by default. Set `solid.root` to use a different base directory.

For a server build that renders HTML for hydration, use the following settings.

```ts
export default {
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ const solidLoader: LoaderDefinition<SolidLoaderOptions> = async function (

const filename = getTransformFilename(resourceFilename);
const { compiler = 'native', decoratorVersion } = options;
const solid = { dev: this.mode === 'development', ...options.solid };
const solid = {
dev: this.mode === 'development',
...options.solid,
root: options.solid?.root ?? this.rootContext,
};
const refresh =
options.refresh ??
(this.mode === 'development' &&
Expand Down