import { type Plugin, type UserConfigExport } from 'vite'; export interface ReloadConfig { /** * If false, automatic browser reloading on rebuild will be disabled. * Defaults to true. */ readonly enabled?: boolean; /** * Number of milliseconds to delay reloading after a build completes. * Defaults to 1000 (1 second). */ readonly delay?: number; /** * **NOTE:** _This only affects the client! This is an advanced option that * can be used to bypass a reverse proxy in front of the preview server that * does not proxy/forward the websocket connection. This is the * `vite-live-preview` equivalent to the Vite `server.hmr.clientPort` * option._ * * WebSocket connection port that the client will connect to. Defaults to the * local preview server port. */ readonly clientPort?: number; } export interface LivePreviewOptions { /** * If true, debug messages will be printed to the console. Defaults to false. */ readonly debug?: boolean; /** * Allow or disable automatic browser reloading on rebuild. Defaults to true. */ readonly reload?: boolean | ReloadConfig; /** * Additional configuration that should only be applied only to the live * preview server. This is deeply merged into the inherited main Vite config. */ readonly config?: UserConfigExport; } /** * Start a preview server when building with file watching enabled (eg. `vite * build --watch`). */ export default function pluginPreview({ debug: isDebugEnabled, reload, config: previewOverrideConfig, }?: LivePreviewOptions): Plugin;