Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

PrerenderedPage

interfaz

HTML generado en el build para una URL prerenderizada.

ts
import type { PrerenderedPage } from "@meekojs/meeko/server";

Source code src/server/runtime/framework-render.ts:350

Declaración #

ts
interface PrerenderedPage {
	readonly html: string
	readonly headOffset: number
	readonly etag: string
	readonly payload?: string
	readonly scriptHashes?: readonly string[]
	readonly styleHashes?: readonly string[]
}

Example #

ts
import { readFile } from "node:fs/promises";
import type { PrerenderedPage } from "@meekojs/meeko/server";

const entry = index.pages["/"]!;
const page: PrerenderedPage = {
  html: await readFile(`prerender/${entry.file}`, "utf8"),
  headOffset: entry.headOffset,
  etag: entry.etag,
};

Propiedades #

html #

propiedad sólo lectura

readonly html: string

Documento completo.

headOffset #

propiedad sólo lectura

readonly headOffset: number

Posición dentro de <head> donde se inserta la meta CSRF de cada petición, en unidades de código UTF-16 de html (un índice de cadena de JavaScript), nunca en bytes.

etag #

propiedad sólo lectura

readonly etag: string

ETag del documento.

payload #

propiedad sólo lectura opcional

readonly payload?: string

Payload de navegación que reciben las navegaciones de cliente a la misma URL.

scriptHashes #

propiedad sólo lectura opcional since 1.7.0

readonly scriptHashes?: readonly string[]

Fuentes CSP 'sha256-…' de sus scripts en línea, como scriptHashes del índice de prerender. Con server.contentSecurityPolicy, la página se sirve con ellas; si faltan, se calculan del HTML.

styleHashes #

propiedad sólo lectura opcional since 1.7.0

readonly styleHashes?: readonly string[]

Fuentes CSP 'sha256-…' de sus <style> en línea, como styleHashes del índice de prerender.

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/runtime/framework-render.ts