[]previous and next page

prerenderTargets

Which paths to prerender from literal settings: routes with export const prerender = true and a static path, export const prerender = ["/a", "/b"], routes with export const ssr = false (their shell), and the paths given in routes.

Which paths to prerender from literal settings: routes with export const prerender = true and a static path, export const prerender = ["/a", "/b"], routes with export const ssr = false (their shell), and the paths given in routes. Function forms are resolved by resolvePrerenderTargets.

Import#

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

Signature#

ts
function prerenderTargets(scan: ScanResult, options: PrerenderOptions): PrerenderTarget[]

Parameters#

Name Description
scan The scanned routes.
options Prerender options.

Returns#

Targets sorted by path.

Throws#

  • PrerenderError for prerender = true on a route with params (list the paths instead).

Examples#

ts
prerenderTargets(scan, { routes: ["/extra"] }); // [{ path: "/about", shell: false }, ...]