Skip to content

solidjs-community/solid-node-register

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solid Node Register

Solid Node Register

version

Node loader for compiling JSX/TSX files using Solid's compiler. Uses Node's Module Customization Hooks to register the loader for .jsx and .tsx files.

Requires Node >=20.6.0.

Usage

Install the loader

npm i solid-node-register # or pnpm, yarn, etc.

Run jsx/tsx files in SSR mode

node --import solid-node-register ./index.tsx

Run jsx/tsx files in client mode.
Requires a "browser" condition to import the browser solid runtime.
Also requires the DOM API to be mocked with jsdom or similar.

node -C browser --import solid-node-register ./index.tsx

TypeScript

This loader only handles the compilation of .jsx/.tsx files.
For .ts files you can use --experimental-strip-types, tsx or ts-node.

Example

See the tests folder for a client/ssr code example
and package.json for a test script to run it.

About

Node loader for compiling JSX/TSX files using Solid's compiler.

Resources

License

Stars

Watchers

Forks