UNPKG

@honohub/vite

Version:

Vite plugin for honohub

23 lines (22 loc) 1.15 kB
import type { AnyDrizzleDB } from "drizzle-graphql"; import type { SanitizedHub } from "honohub"; import type { PluginOption } from "vite"; import { type BuildOptions, type TemplateGeneratorProps } from "./react"; /** * Options for configuring HonoHub Vite. * * @template Database - The type of the database used by HonoHub. * @property {SanitizedHub<Database>} config - The sanitized configuration for HonoHub. * @property {string} [basePath] - The base path of the admin panel. * @property {string} [override] - The import override option. * @property {Partial<BuildOptions>} [build] - The build options. * @property {(options: TemplateGeneratorProps<Database>) => void | Promise<void>} [generator] - The template generator function. */ export type HonoHubViteOptions<Database extends AnyDrizzleDB<any>> = { config: SanitizedHub<Database>; basePath?: string; override?: string; build?: Partial<BuildOptions>; generator?: (options: TemplateGeneratorProps<Database>) => void | Promise<void>; }; export default function honohub<Database extends AnyDrizzleDB<any>>(options: HonoHubViteOptions<Database>): PluginOption;