# @solidjs/compiler Solid 2.0's native Oxc JSX compiler. Integrations call `transform()` once per source module; this package is not a Vite, Rollup, or Babel plugin by itself. The JavaScript fallback is [`@solidjs/babel-plugin`](../babel-plugin). > **Solid 2.0.** Pin exact versions. The Node `transform()` interface is the supported public contract; the Rust `compile` API is unstable. ## Installation ```bash npm install @solidjs/compiler ``` The package ships prebuilt native binaries as optional per-platform packages (`@solidjs/compiler-darwin-arm64`, `-darwin-x64`, `-linux-x64-gnu`, `-linux-arm64-gnu`, `-win32-x64-msvc`). Your package manager installs the one matching your platform. On other platforms, build from source with `pnpm run build` inside `packages/compiler` (requires a Rust toolchain). ### WebAssembly and StackBlitz A WASI fallback covers environments such as StackBlitz WebContainers, where Node reports a native platform but cannot load `.node` addons. Package managers install `@solidjs/compiler-wasm32-wasi` as an optional dependency. The package entry prefers a native binding and falls back to WASI when native addons are unavailable. - `NAPI_RS_FORCE_WASI=error` requires the WASI binding (useful in tests). - `SOLID_COMPILER_NATIVE=/path/to/binding.node` loads an explicit native addon. ## Usage Omitted options match `@solidjs/babel-plugin` (and the old `babel-preset-solid`): `moduleName` is `"@solidjs/web"`, `generate` is `"dom"`, and control-flow tags (`For`, `Show`, `Switch`, `Match`, `Loading`, `Reveal`, `Portal`, `Repeat`, `Dynamic`, `Errored`) are auto-imported from that module. ```js const { transform } = require("@solidjs/compiler"); const result = transform(`const view =