Installation#

@sigx/vite is an ESM-only package ("type": "module", sideEffects: false). It supports Node ^20.19.0 || >=22.12.0.

Install#

Terminal
npm install -D @sigx/vite
Terminal
pnpm add -D @sigx/vite
Terminal
yarn add -D @sigx/vite

Peer Dependencies#

Both peer dependencies are required and are not bundled — install them yourself:

PeerVersion rangeNotes
vite>= 8.0.0The plugin targets Vite 8 (Rolldown).
sigx*The SignalX runtime the plugin shares as a singleton.
Terminal
npm install vite sigx

Configure Vite#

Add the plugin to the plugins array in vite.config.ts. The default export is the plugin factory:

TypeScript
// vite.config.ts
import { defineConfig } from 'vite';
import sigx from '@sigx/vite';

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

The named export sigxPlugin is equivalent if you prefer it:

TypeScript
import { sigxPlugin } from '@sigx/vite';

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

The plugin runs with enforce: 'pre' and only transforms first-party .ts/.tsx/.jsx files — it skips node_modules and /dist/.

Configure TypeScript#

For JSX/TSX, point TypeScript's JSX transform at SignalX:

JSON
// tsconfig.json
{
    "compilerOptions": {
        "jsx": "react-jsx",
        "jsxImportSource": "sigx"
    }
}

If you use the type-generation output (see the Commands guide), add its output directory to include so the editor picks it up:

JSON
// tsconfig.json
{
    "include": ["src", "node_modules/.sigx/**/*.d.ts"]
}

Package Entry Points#

The package exposes three entry points through its exports map:

Import pathPurpose
@sigx/viteThe plugin (default and sigxPlugin export) plus HMR re-exports.
@sigx/vite/hmrThe browser-side HMR runtime (injected automatically).
@sigx/vite/libdefineLibConfig for building @sigx/* libraries.

Next Steps#