Skip to main content
Home

A Bun plugin for transforming SolidJS TSX/JSX files at runtime or build time using Babel. Supports SSR and DOM output.

This package works with Bun
This package works with Bun
JSR Score
94%
Published
2 days ago (1.0.3)
function SolidPlugin
SolidPlugin(options?: Partial<SolidPluginOptions>): Bun.BunPlugin

A Bun plugin for transforming SolidJS .tsx/.jsx files at build time using Babel.

This plugin uses the babel-preset-solid and @babel/preset-typescript presets to convert Solid JSX into DOM or SSR-compatible output, depending on the configuration.

Examples

Example 1

// Using Bun.build
import { SolidPlugin } from "@dschz/bun-plugin-solid";

await Bun.build({
  entrypoints: ["./src/index.ts"],
  outdir: "./dist",
  target: "bun",
  format: "esm",
  plugins: [
    SolidPlugin({
      generate: "ssr",
      hydratable: true,
      sourceMaps: false, // recommended for production
    }),
  ],
});
  • @example
// Using Bun.plugin
import { SolidPlugin } from "@dschz/bun-plugin-solid";

// You must pass this script to `preload` in your `bunfig.toml`
await Bun.plugin(
  SolidPlugin({
    generate: "ssr",
    hydratable: true,
    sourceMaps: true,
  }),
);

Parameters

optional
options: Partial<SolidPluginOptions>
  • Configuration for JSX transform behavior, hydration support, source maps, and debug output.

Return Type

Bun.BunPlugin

A Bun-compatible plugin object that can be passed to bun build.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

bunx jsr add @dschz/bun-plugin-solid

Import symbol

import { SolidPlugin } from "@dschz/bun-plugin-solid";