---
title: "Asset.script ViewHelper <vite:asset.script>"
manual: "Vite AssetCollector"
version: "main"
permalink: "https://docs.typo3.org/permalink/praetorius/vite-asset-collector:viewhelper-asset-script@main"
source: "Reference/ViewHelpers/AssetScript.rst"
rendered: "2026-11-08T20:31:06+00:00"
---

# Asset.script ViewHelper `<vite:asset.script>` {#viewhelper-asset-script}

The `<vite:asset.script>` ViewHelper allows to customize the embedding of
script assets with the `<vite:asset>` ViewHelper. It can only be used as a
direct child element of `<vite:asset>`.

See [\<vite:asset>](https://docs.typo3.org/permalink/praetorius/vite-asset-collector:viewhelper-asset@main)
for more examples.

## Example: Disable preloading of imports {#example-disable-preloading-of-imports}

```html
<vite:asset entry="EXT:sitepackage/Resources/Private/JavaScript/Main.entry.js">
    <vite:asset.script preloadImports="{false}" />
</vite:asset>
```

**Arguments**

The following arguments are available for the asset.script ViewHelper:

-   **additionalAttributes**

    -   *Type:* array
    -   *Default:* array (
    )

    Additional attributes to be added to the \<script> tag.

-   **async**

    -   *Type:* bool
    -   *Default:* false

    Set to "true" if the script should be executed as soon as it is loaded. Can be used for JavaScript modules and classic scripts.

-   **defer**

    -   *Type:* bool
    -   *Default:* false

    Set to "true" if the classic script should be executed after the document has been parsed. JavaScript modules are always deferred, so this can only be used with module="{false}".

-   **ignore**

    -   *Type:* bool
    -   *Default:* false

    Set to "true" if the script should not be embedded at all.

-   **module**

    -   *Type:* bool
    -   *Default:* true

    Set to "false" if the script should be embedded as a classic script instead of a JavaScript module (e. g. for non-ESM build output).

-   **nomodule**

    -   *Type:* bool
    -   *Default:* false

    Set to "true" if the classic script should be used as an alternative to a JavaScript module. Can only be used with module="{false}".

-   **preloadImports**

    -   *Type:* bool
    -   *Default:* true

    Set to "false" if imported scripts should not be preloaded automatically.

-   **priority**

    -   *Type:* bool
    -   *Default:* false

    Set to "true" if the script should be embedded in the \<head> of the document.
