Skip to content

ui-router-server / prerender / PrerenderOptions

Interface: PrerenderOptions ​

Defined in: prerender.ts:56

Options for prerender.

Properties ​

PropertyTypeDescriptionDefined in
dryRun?booleanPlans everything and writes nothing — neither pages nor the rules file.prerender.ts:116
extraRules?RedirectLine[]Lines prepended to the generated ones, verbatim — a site's own legacy redirects.prerender.ts:102
mounts?Record<string, MountConfig>The mount table, compiled here — or pass an already-compiled resolver.prerender.ts:58
notFound?| false | { file?: string; probe?: string; }The 404 document, emitted once from the otherwise projection. false emits none, and nothing is emitted when the probed mount declares no projection.prerender.ts:78
outDirstringDirectory the files are written under.prerender.ts:64
paths| Iterable<string, any, any> | AsyncIterable<string, any, any>Every path to ask for a verdict. Redirect and notFound paths belong here too.prerender.ts:62
render(verdict, context) => string | Promise<string>Renders one shell verdict to the file's full text, document included. Renders run one at a time, in enumeration order, then the 404 document.prerender.ts:69
resolver?ServerRouterA resolver from createServerRouter, instead of mounts.prerender.ts:60
rules?"_redirects" | "none" | ((lines) => void | Promise<void>)'_redirects' (default) writes the Cloudflare Pages / Netlify file; 'none' writes nothing and leaves PrerenderResult.rules to the caller; a function receives the lines and writes whatever the host reads. No SPA catch-all is ever written — one turns every 404 into a 200.prerender.ts:97
trailingSlash?"both" | "exact"'both' (default) emits every generated redirect line twice, with and without the trailing slash: a static host that appends one would otherwise miss the rule. Shell verdicts need no rules line — they are written as <subpath>/index.html, which both spellings reach — but a host that reaches it by redirecting <subpath> to <subpath>/ boots the client at the slashed url, so the client's strictMode(false) and the mount's config: { strict: false } must both admit it.prerender.ts:112
writeFileWriterWrites each file; pass one over node:fs, a virtual fs, or memory.prerender.ts:114