UNPKG

fully-react

Version:
36 lines (33 loc) 1.09 kB
import { Manifest, ModuleNode } from 'vite'; declare global { var serverManifest: { [key: string]: { file: string; }; }; var clientManifest: { [key: string]: { file: string; }; }; } /** * Traverses the module graph and collects assets for a given chunk * * @param manifest Client manifest * @param id Chunk id * @param assetMap Cache of assets * @returns Array of asset URLs */ declare const findAssetsInManifest: (manifest: Manifest, id: string, assetMap?: Map<string, Array<string>>) => Array<string>; declare const findAssetsInModuleNode: (moduleNode: ModuleNode) => string[]; /** * Generates a link tag for a given file. This will load stylesheets and preload * everything else. It uses the file extension to determine the type. */ declare function renderLinkTag(file: string): string; type Handler = ({ request, }: { request: Request; }) => Promise<Response> | Response; declare function createHandler(): Handler; export { createHandler, findAssetsInManifest, findAssetsInModuleNode, renderLinkTag };