Skip to content

Commit b0df2b7

Browse files
committed
Update README for usage instructions
1 parent f3cdeda commit b0df2b7

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

readme.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
11
# Solid Node Loader
2+
3+
Node loader for compiling JSX/TSX files using Solid's compiler.
4+
5+
## Usage
6+
7+
Install the loader
8+
9+
```bash
10+
npm i solid-node-loader # or pnpm, yarn, etc.
11+
```
12+
13+
Run jsx/tsx files in SSR mode
14+
15+
```bash
16+
node --import=solid-node-loader ./index.tsx
17+
```
18+
19+
Run jsx/tsx files in client mode.\
20+
Requires a browser condition to import the browser solid runtime.\
21+
Also requires for the DOM api to be mocked with `jsdom` or similar.
22+
23+
```bash
24+
node --conditions=browser --import=solid-node-loader/client ./index.tsx
25+
```
26+
27+
## Example
28+
29+
See the [tests](./tests) folder for a client/ssr code example\
30+
and [package.json](.package.json) for a test script to run it.

0 commit comments

Comments
 (0)