@tsrx/rspack-plugin-solid
v0.0.100
Published
Rspack plugin for @tsrx/solid
Keywords
Readme
@tsrx/rspack-plugin-solid
Rspack plugin for compiling @tsrx/solid .tsrx files.
Installation
pnpm add @tsrx/solid solid-js @solidjs/web
pnpm add -D @tsrx/rspack-plugin-solidUsage
import { TsrxSolidRspackPlugin } from '@tsrx/rspack-plugin-solid';
export default {
plugins: [new TsrxSolidRspackPlugin()],
};The plugin compiles .tsrx modules with @tsrx/solid, runs the final TypeScript
and Solid JSX transform through babel-loader with @babel/preset-typescript and
babel-preset-solid, and emits sibling-scoped <style> blocks (each styles its
siblings and everything below them) through Rspack's built-in CSS module type.
It also pushes .tsrx into resolve.extensions and enables experiments.css
when unset. In development mode it adds solid-refresh/babel unless you pass
hot: false.
Options
hot: whether to addsolid-refresh/babelto the Babel pipeline. Defaults totrueunless Rspack is running in production mode.runtimeImports: helper import mode ('compiler'by default, or'direct'for standalone runtime imports).platform: optional override/fallback for the compile-time platform. Normally the plugin readstsrx.platformfrom the project tsconfig (includingresolve.tsConfigandextends). An override must match tsconfig. The plugin defines all three exact flags and rejects conflicting Rspack definitions.
When using runtimeImports: 'direct', install the runtime as a direct production
dependency of the package that owns the compiled modules:
pnpm add @tsrx/solid-runtimeThe plugin only emits bare @tsrx/solid-runtime/* imports and does not provide
the runtime package.
