---
url: >-
  https://lit-ui-router.dev/reference/ui-router-server/prerender/interfaces/PrerenderOptions.md
---
[ui-router-server](../../index.md) / [prerender](../index.md) / PrerenderOptions

# Interface: PrerenderOptions

Defined in: [prerender.ts:105](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L105)

Options for [prerender](../functions/prerender.md).

## Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
|  `base?` | `string` | The url path `outDir` is served at, such as Vite's `base`; `/` by default. The mounts stay at `/` and page files don't move: the base goes once onto each generated rules line's `from` and host-absolute `to`. [extraRules](#extrarules) are written as given. Defaults to the [resolver](#resolver)'s own `base`; a different value throws, as does a relative or full-URL base. A [mounts](#mounts) table keyed by the base compiles as `createServerRouter({ base, mounts })` would. Either way, [paths](#paths) lie under the base, with it taken off. | [prerender.ts:154](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L154) |
|  `dryRun?` | `boolean` | Plans everything and writes nothing — neither pages nor the rules file. | [prerender.ts:209](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L209) |
|  `extraRules?` | [`RedirectLine`](RedirectLine.md)\[] | Lines prepended to the generated ones, verbatim — a site's own legacy redirects. | [prerender.ts:205](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L205) |
|  `mounts?` | `Record`<`string`, [`MountConfig`](../../index/interfaces/MountConfig.md)\<readonly [`RouteDeclaration`](../../redirects/interfaces/RouteDeclaration.md)\[]>> | The mount table, compiled here — or pass an already-compiled [resolver](#resolver). | [prerender.ts:107](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L107) |
|  `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:183](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L183) |
|  `outDir` | `string` | Directory the files are written under. | [prerender.ts:141](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L141) |
|  `paths` | | `Iterable`<`string`, `any`, `any`> | `AsyncIterable`<`string`, `any`, `any`> | Every path to ask for a verdict. Redirect and notFound paths belong here too. They spell the [base](#base) when [pathsIncludeBase](#pathsincludebase) is on, as it is by default for a router that declares one, and lie under it with it taken off otherwise. | [prerender.ts:121](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L121) |
|  `pathsIncludeBase?` | `boolean` | Whether each of [paths](#paths) spells the [base](#base), as a host serves it: `/app/about` under `/app/`. When `true`, the base is taken off each path once, before anything else sees it, so the output matches the base-free listing; a path outside the base throws. When `false`, a path is read as given, even one that starts with the base. `pages`, `warnings` and `delegated` report each path as listed. Under base `/` it changes nothing. Defaults to whether the router declares a base: `true` for a [resolver](#resolver) from `createServerRouter({ base, mounts })` or a [mounts](#mounts) table keyed by the base, so a table that spells real urls lists real urls; `false` for a table at `/` stripped under a `base`, so its paths stay the same at any base. The default follows that declaration, never the shape of the paths. | [prerender.ts:139](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L139) |
|  `render` | (`verdict`, `context`) => | `string` | [`RenderedRedirect`](RenderedRedirect.md) | `Promise`<`string` | [`RenderedRedirect`](RenderedRedirect.md)> | Renders one shell verdict to the file's full text, document included, or answers a [RenderedRedirect](RenderedRedirect.md) for a page whose render found it redirects, such as a `redirectTo` function `settle` followed: the path gets a rules line and no page. Renders run one at a time, in enumeration order, then the 404 document, which must render a page. | [prerender.ts:162](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L162) |
|  `resolver?` | [`ServerRouter`](../../index/interfaces/ServerRouter.md)<[`RouteDeclaration`](../../redirects/interfaces/RouteDeclaration.md)> | A resolver from `createServerRouter`, instead of [mounts](#mounts); its mounts' trailing-slash policies come with it. Any other resolver is read as `'as-requested'`. | [prerender.ts:113](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L113) |
|  `respond?` | (`verdict`, `context`) => | [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) | `Promise`<[`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)> | Answers one response verdict: settle the state and run the handler bound to its name. A 2xx answer's body, read as text, is written to the path its url spells (`badge.svg`; `index.html` at the mount root), its headers dropped; a 3xx becomes a rules line to its `Location`; any other status throws. Runs in the same sequence as `render`. `lit-ui-router-ssr`'s `prerender` supplies it from the handlers bound by state name. | [prerender.ts:174](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L174) |
|  `rules?` | [`RulesWriter`](../type-aliases/RulesWriter.md) | `"_redirects"` | `"none"` | `'_redirects'` (default) writes the Cloudflare Pages / Netlify file; `'none'` writes nothing and leaves [PrerenderResult.rules](PrerenderResult.md#rules) to the caller; a function receives the lines and writes whatever the host reads, such as `redirectPages` for a host with no redirect rules. No SPA catch-all is ever written — one turns every 404 into a 200. | [prerender.ts:203](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L203) |
|  `write` | [`FileWriter`](../type-aliases/FileWriter.md) | Writes each file; pass one over `node:fs`, a virtual fs, or memory. | [prerender.ts:207](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/prerender.ts#L207) |
