@brickkit/cli/vite
The Vite plugin that generates the typed client contract and serves the dashboard.
@brickkit/cli/vite exports 3 names: 1 function, 2 interfaces.
import { brickClient } from "@brickkit/cli/vite";Functions
| Function | Description |
|---|---|
brickClient | Load a BrickApp through Vite's server module graph, including dependency HMR. |
brickClient
function brickClient(options: BrickClientPluginOptions): PluginLoad a BrickApp through Vite's server module graph, including dependency HMR.
Parameters
| Name | Type | Description |
|---|---|---|
options | BrickClientPluginOptions |
Returns Plugin
Source: packages/cli/src/vite.ts:42
Interfaces
BrickClientPluginOptions
interface BrickClientPluginOptionsProperties
| Name | Type | Description |
|---|---|---|
entry | string | Any module whose default export is a BrickApp; do not call listen() there. |
output? | string | Generated browser contract, relative to the Vite root (default _brick/contract.ts). |
dashboard? | | ({ port?: number; historyDays?: number } & DashboardExtensionOptions) | false | Local dashboard for the app's requests, traces, errors, and reloads, served during vite dev (default: on at port 9400). Apps must pass telemetry: true to brick() to record requests. historyDays is how long finished requests are kept in .brick/ (default 90, 0 for none). Set to false to disable. extension (relative to the Vite root) and theme customise it, as in brick dev. |
Source: packages/cli/src/vite.ts:23
DashboardTheme
interface DashboardThemeToken values for the dashboard's light and dark themes, its radius and fonts.
Properties
| Name | Type | Description |
|---|---|---|
light? | Record<string, string> | Colour tokens in light mode, by name: { primary: "oklch(0.55 0.2 260)" }. |
dark? | Record<string, string> | Colour tokens in dark mode. |
radius? | string | The base corner radius, such as "0.5rem". |
fonts? | { sans?: string; mono?: string } | CSS font stacks. The page must be able to load the font. |