Skip to content

View Helpers

viteScriptTag()

viteScriptTag() — returns string

Available in: controller Category: Asset Functions

Returns ‘script’ tags for a Vite JS entrypoint. In development, also injects the Vite client for Hot Module Replacement (HMR). In production, includes any associated CSS files from the manifest as tags.

NameTypeRequiredDefaultDescription
entrypointstringyesThe source entrypoint path (e.g. “src/main.js”).
headbooleannofalseSet to true to place output in the <head> area instead of inline.