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

# Interface: PrerenderOptions

Defined in: [prerender.ts:56](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L56)

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

## Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
|  `dryRun?` | `boolean` | Plans everything and writes nothing — neither pages nor the rules file. | [prerender.ts:116](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L116) |
|  `extraRules?` | [`RedirectLine`](RedirectLine.md)\[] | Lines prepended to the generated ones, verbatim — a site's own legacy redirects. | [prerender.ts:102](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L102) |
|  `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:58](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L58) |
|  `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](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L78) |
|  `outDir` | `string` | Directory the files are written under. | [prerender.ts:64](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L64) |
|  `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](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L62) |
|  `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](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L69) |
|  `resolver?` | [`ServerRouter`](../../index/interfaces/ServerRouter.md)<[`RouteDeclaration`](../../redirects/interfaces/RouteDeclaration.md)> | A resolver from `createServerRouter`, instead of [mounts](#mounts). | [prerender.ts:60](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L60) |
|  `rules?` | `"_redirects"` | `"none"` | ((`lines`) => `void` | `Promise`<`void`>) | `'_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. No SPA catch-all is ever written — one turns every 404 into a 200. | [prerender.ts:97](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L97) |
|  `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](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L112) |
|  `write` | [`FileWriter`](../type-aliases/FileWriter.md) | Writes each file; pass one over `node:fs`, a virtual fs, or memory. | [prerender.ts:114](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/prerender.ts#L114) |
