marko/vite

Vite integration for the Marko Framework - asset manifest resolution and dev-server detection

Maintainers

Package info

github.com/marko-php/marko-vite

Type:marko-module

pkg:composer/marko/vite

Statistics

Installs: 1

Dependents: 4

Suggesters: 0

Stars: 0

0.5.0 2026-05-01 14:38 UTC

This package is auto-updated.

Last update: 2026-05-02 01:32:35 UTC


README

Vite integration for the Marko Framework — asset manifest resolution and dev-server detection for production builds and HMR.

Installation

composer require marko/vite

Quick Example

use Marko\Vite\Vite;

class LayoutController
{
    public function __construct(
        private readonly Vite $vite,
    ) {}

    public function head(): string
    {
        return $this->vite->headTags('app/web/resources/js/app.js');
    }
}

In dev (vite.useDevServer = true), this emits <script type="module"> tags pointing at the Vite dev server. In production, it reads public/build/.vite/manifest.json and emits hashed <script>, <link rel="stylesheet">, and <link rel="modulepreload"> tags.

Documentation

Full usage, API reference, and examples: marko/vite