Skip to content

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

NameTypeRequiredDescription
noncestringNoReadonly. A CSP nonce for the inline import-map element.
errorHtmlstringNoReadonly. Trusted catalog-independent host error markup; omit for a generic reload/home view.
langstringNoReadonly. 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.
htmlAttributesReadonly<Record<string, string>>NoReadonly. 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.

Source entry on GitHub

Last updated: November 1, 2026