UNPKG

vite-plugin-server-actions

Version:

Server actions for Vite - call backend functions directly from your frontend with automatic API generation, TypeScript support, and zero configuration

36 lines (29 loc) 657 B
import type { Plugin } from "vite"; import type { Express } from "express"; export interface ServerActionOptions { /** * Custom API prefix for server action endpoints * @default "/api" */ apiPrefix?: string; /** * Include patterns for server action files * @default "**\/*.server.js" */ include?: string | string[]; /** * Exclude patterns for server action files */ exclude?: string | string[]; } export interface ServerFunction { name: string; isAsync: boolean; } export interface ServerModule { functions: string[]; id: string; } export interface ServerActionsPlugin extends Plugin { name: "vite-plugin-server-actions"; }