Skip to content

taskylizard/oxc-solid-js

Repository files navigation

oxc-solid-js

Native JSX compiler for Solid.js users built with the OXC toolchain.

Very work in progress, but I encourage you to try it out and report issues!

Install

# compiler
npm install @oxc-solid-js/compiler

# vite plugin
npm install -D @oxc-solid-js/vite

# rolldown plugin
npm install -D @oxc-solid-js/rolldown

Usage

Vite

// vite.config.js
import { defineConfig } from "vite";
import solidOxc from "@oxc-solid-js/vite";

export default defineConfig({
  plugins: [solidOxc()],
});

Options:

solidOxc({
  generate: "dom", // "dom" | "ssr" | "universal"
  hydratable: false,
  hot: true, // HMR via solid-refresh (dev only)
});

Rolldown

// rolldown.config.js
import solidOxc from "@oxc-solid-js/rolldown";

export default {
  plugins: [solidOxc()],
};

Direct API

import { transformJsx } from "@oxc-solid-js/compiler";

const { code, map } = transformJsx(`<div class="hello">world</div>`, {
  generate: "dom",
  moduleName: "solid-js/web",
  sourceMap: true,
});

License

This project is licensed under the MIT License.

This project also contains code derived or copied from the following projects:

Licenses of these projects are listed in THIRD-PARTY-LICENSES.

About

Native JSX compiler for Solid.js

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors