VitePlugin
ts
type VitePlugin: object;
Type declaration
buildEnd()
ts
buildEnd: (error?) => Promise<void> | void;
Parameters
• error?: Error
Returns
Promise
<void
> | void
buildStart()
ts
buildStart: (options) => Promise<void> | void;
Parameters
• options: unknown
Returns
Promise
<void
> | void
enforce
ts
enforce: "pre" | "post";
load()
ts
load: (id) => Promise<string> | null;
Parameters
• id: string
Returns
Promise
<string
> | null
name
ts
name: string;
resolveId()
ts
resolveId: (source) => string | null;
Parameters
• source: string
Returns
string
| null
transform()
ts
transform: (code, id, options?) => Promise<string> | string;
Parameters
• code: string
• id: string
• options?
• options.ssr?: boolean
Returns
Promise
<string
> | string
transformIndexHtml
ts
transformIndexHtml: object;
transformIndexHtml.handler()
ts
handler: (html, ctx) => Promise<object>;
Parameters
• html: string
• ctx
• ctx.filename: string
Returns
Promise
<object
>
html
ts
html: string;
tags
ts
tags: HtmlTag[];
transformIndexHtml.order
ts
order: "pre" | "post";