Function: wirestate()
ts
function wirestate(options?: WirestateVitePluginOptions): WirestateVitePlugin;Defined in: src/wirestate-dev/vite.ts:104
Creates the Wirestate hot-reload plugin for Vite.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | WirestateVitePluginOptions | Plugin options. |
Returns
Vite plugin instance.
Remarks
Development-only (apply: "serve"): production builds are never transformed. Requires @wirestate/core to be resolvable from the application, since the injected footer imports @wirestate/core/hot.
Example
typescript
import { wirestate } from "@wirestate/dev/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [wirestate(), react()],
});