Skip to content

marko-php/marko-vite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marko/vite

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

About

[READ-ONLY] Vite integration for the Marko Framework - asset manifest resolution and dev-server detection. Issues and PRs at https://github.com/marko-php/marko

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages