Skip to content

Search the guides, deployment pages, and API reference.

renderImportMap

import { renderImportMap } from "@pitlane/assets";
function renderImportMap(__namedParameters): string;

Serializes an import map into an inline <script type="importmap"> element for server-rendered HTML, or "" when the map has no mappings.

Every < in the JSON is written as \u003c, so no key or URL can end the script element; the browser parses the same strings back. The nonce is written as an escaped, quoted attribute. Place the result before any modulepreload link or module script.

Parameters

__namedParameters

RenderImportMapOptions

Returns

string