UNPKG

v-vite

Version:

A Vite.js plugin for integrating the V programming language with modern frontend tooling.

67 lines (64 loc) 1.78 kB
import { InputOption } from 'rollup'; import { Plugin, UserConfig, ConfigEnv } from 'vite'; import { Config } from 'vite-plugin-full-reload'; interface PluginConfig { /** * The path or paths of the entry points to compile. */ input: InputOption; /** * V's public directory. * * @default 'public' */ publicDirectory?: string; /** * The public subdirectory where compiled assets should be written. * * @default 'build' */ buildDirectory?: string; /** * The path to the "hot" file. * * @default `${publicDirectory}/hot` */ hotFile?: string; /** * The path of the SSR entry point. */ ssr?: InputOption; /** * The directory where the SSR bundle should be written. * * @default 'ssr' */ ssrOutputDirectory?: string; /** * Configuration for performing full page refresh on blade (or other) file changes. * * {@link https://github.com/ElMassimo/vite-plugin-full-reload} * @default false */ refresh?: boolean | string | string[] | RefreshConfig | RefreshConfig[]; /** * Transform the code while serving. */ transformOnServe?: (code: string, url: DevServerUrl) => string; } interface RefreshConfig { paths: string[]; config?: Config; } interface VPlugin extends Plugin { config: (config: UserConfig, env: ConfigEnv) => UserConfig; } type DevServerUrl = `${'http' | 'https'}://${string}:${number}`; declare const refreshPaths: string[]; /** * V plugin for Vite. * * @param config - A config object or relative path(s) of the scripts to be compiled. */ declare function v(config: string | string[] | PluginConfig): [VPlugin, ...Plugin[]]; export { v as default, refreshPaths };