vite-preload
Version:
Speed up your Vite application by preloading server rendered lazy modules and stylesheets as early as possible
21 lines (20 loc) • 689 B
TypeScript
export interface Preload {
rel: 'stylesheet' | 'modulepreload' | 'module' | 'preload';
href: string;
as?: string;
type?: string;
nonce?: string;
comment?: string;
isEntry?: boolean;
asyncScript?: boolean;
}
export declare function createHtmlTag({ rel, href, as, type, comment, nonce, asyncScript, }: Preload): string | null;
/**
* Create a combined Link header separated by ,
*/
export declare function createLinkHeader(modules: Preload[]): string;
/**
* Creates a single Link header
*/
export declare function createSingleLinkHeader({ rel, href, as, type }: Preload): string | null;
export declare function sortPreloads(modules: Preload[]): Preload[];