Skip to content

View Helpers

vitePreloadTag()

vitePreloadTag() — returns string

Available in: controller Category: Asset Functions

Returns tags for a Vite entrypoint and its transitive chunk imports. Useful for Turbo Drive hover-preload patterns or for explicitly warming assets a subsequent navigation will need. In development mode, returns an empty string — Vite handles module resolution dynamically and modulepreload is unnecessary.

emits via $viteHtmlHead() so tags land in .

NameTypeRequiredDefaultDescription
entrypointstringyesThe source entrypoint path (e.g. “src/main.js”).
headbooleannotrueSet to false to return the markup for inline placement; default true