bohn-media/contao-vite-bundle

Vite Bundle for Contao 5

Maintainers

Package info

github.com/bohn-media/contao-vite-bundle

Type:contao-bundle

pkg:composer/bohn-media/contao-vite-bundle

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.3.0 2026-04-27 15:34 UTC

This package is auto-updated.

Last update: 2026-04-27 16:04:57 UTC


README

A small Contao 5 wrapper around pentatrion/vite-bundle. It registers PentatrionViteBundle in Contao Manager Edition and exposes the most common rendering helpers as Contao insert tags.

Installation

composer require bohn-media/contao-vite-bundle

The bundle expects Vite to output its build artifacts into public/build/ (the default).

Rendering entry tags

Render the link and script tags for a Vite entry.

Twig

{{ vite_entry_link_tags('app') }}
{{ vite_entry_script_tags('app') }}

Insert tag

{{vite_entry_link_tags::app}}
{{vite_entry_script_tags::app}}

If the entry name is missing or rendering fails (e.g. unknown entry, broken entrypoints.json), the insert tags render as an empty string and log an error instead of throwing.

Resolving individual asset URLs

A named asset package vite is registered automatically, so Vite-hashed assets resolve via Symfony's asset() function or Contao's {{asset::}} insert tag.

Twig

{{ asset('@/images/favicon.svg', 'vite') }}

Insert tag

{{asset::@/images/favicon.svg::vite}}

License

MIT.