[]previous and next page

resolvePrerenderTargets

Every page to prerender: the literal settings of prerenderTargets, the paths that the route functions produce, and entries.

Every page to prerender: the literal settings of prerenderTargets, the paths that the route functions produce, and entries. A route's function receives the params of its parent route (a layout's function, or the function of the route above it); a page with no function of its own is prerendered for every set its ancestors produced, and skipped for a set that leaves one of its params out. A function that leaves a param out of its own page is a build error, naming the param.

Import#

ts
import { resolvePrerenderTargets } from "@shadow-js/dusk/vite";

Signature#

ts
async function resolvePrerenderTargets(input: {
  readonly scan: ScanResult;
  readonly options: PrerenderOptions;
  readonly loaders: readonly PrerenderRouteLoader[];
}): Promise<PrerenderTarget[]>

Parameters#

Name Description
input The scan, the options, and the loaders of the route functions (from the server bundle).

Returns#

Targets sorted by path.

Throws#

  • PrerenderError for a function that returns something other than param objects, or leaves a param of its own path out, and for the literal errors of prerenderTargets.

Examples#

ts
await resolvePrerenderTargets({ scan, options: {}, loaders });