View Helpers
vitePreloadTag()
Signature
Section titled “Signature”vitePreloadTag() — returns string
Available in: controller
Category: Asset Functions
Description
Section titled “Description”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 .
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
entrypoint | string | yes | — | The source entrypoint path (e.g. “src/main.js”). |
head | boolean | no | true | Set to false to return the markup for inline placement; default true |