vite-plugin-esi
Version:
Vite plugin to resolve ESI with [nodesi](https://www.npmjs.com/package/nodesi).
25 lines (21 loc) • 495 B
TypeScript
import { Plugin } from 'vite';
import { NodeEsiOptions } from 'nodesi';
type Tag = {
src: string;
type?: 'include' | 'remove';
onError?: 'continue' | 'abort';
};
type EsiTags = {
[name: string]: Tag[];
};
type EsiOptions = {
nodeEsi?: NodeEsiOptions;
headers?: Record<string, string>;
};
type Options = {
esiOptions?: EsiOptions;
esi: EsiTags;
resolveESI?: boolean;
};
declare function esiPlugin(options: Options): Plugin;
export { esiPlugin as default };