Vite Plugin / delivery: ViteDocumentTransformOptions
Functions, types, and exports for Vite Plugin / delivery: ViteDocumentTransformOptions.
Page outline
import type { ViteDocumentTransformOptions } from "@palamedes/vite-plugin/delivery"
type ViteDocumentTransformOptions = {
/** A CSP nonce for the inline import-map element. */
readonly nonce?: string;
/** Trusted catalog-independent host error markup; omit for a generic reload/home view. */
readonly errorHtml?: string;
/**
* The document locale. When set, the transform writes it to `<html lang>`,
* which the generated browser bootstrap reads and checks against the
* locale-bound catalogs. Hosts pass it when the layout cannot know the
* request locale for every document, such as a 404 rendered without route data.
*/
readonly lang?: string;
/**
* Further attributes to set on `<html>`, such as a marker the host's browser
* code reads to render the same markup the server rendered. Names must be
* plain attribute names; values are escaped.
*/
readonly htmlAttributes?: Readonly<Record<string, string>>;
};
Properties
| Name | Type | Required | Description |
|---|---|---|---|
nonce | string | No | Readonly. A CSP nonce for the inline import-map element. |
errorHtml | string | No | Readonly. Trusted catalog-independent host error markup; omit for a generic reload/home view. |
lang | string | No | Readonly. The document locale. When set, the transform writes it to <html lang>,which the generated browser bootstrap reads and checks against the locale-bound catalogs. Hosts pass it when the layout cannot know the request locale for every document, such as a 404 rendered without route data. |
htmlAttributes | Readonly<Record<string, string>> | No | Readonly. Further attributes to set on <html>, such as a marker the host's browsercode reads to render the same markup the server rendered. Names must be plain attribute names; values are escaped. |
Last updated: November 1, 2026