Skip to main content

Vitesse for ExpressionEngine

Vite, without the glue.

Tell a template which entry points it needs. Vitesse prints the right tags for them: from Vite's dev server while you work, with live updates, and from your build when you publish.

ExpressionEngine 7+PHP 8.1+Vite 3+Version 1.0

Free from the ExpressionEngine add-on store.

_partials/layout.html
<head>
{exp:vitesse:css files="resources/js/app.js"}
</head>
<body>
{layout:contents}
{exp:vitesse:js files="resources/js/app.js"}
</body>
printed after vite build
<link rel="stylesheet" href="/build/assets/app-K08chnnp.css">
<link rel="modulepreload" href="/build/assets/vendor-3c4d.js">
<script type="module" src="/build/assets/app-DwbmcGWY.js"></script>

Two modes, one template

It knows whether Vite is running.

A small hot file, written by your Vite config while the dev server runs, tells Vitesse where to load from. Start or stop Vite, and pages follow. Nothing to change in your templates.

npx vite

While you work

Your source files, straight from the dev server, with Vite's client. Save a stylesheet and the page updates.

printed
<script type="module" src="http://localhost:5173/@vite/client"></script>
<script type="module" src="http://localhost:5173/resources/js/app.js"></script>
npx vite build

When you publish

The hashed files from the manifest, with the CSS your scripts import and preloads for shared chunks.

printed
<link rel="stylesheet" href="/build/assets/app-K08chnnp.css">
<link rel="modulepreload" href="/build/assets/vendor-3c4d.js">
<script type="module" src="/build/assets/app-DwbmcGWY.js"></script>

Set up Vite for Vitesse →

Production

Ready for a CDN, a CSP and integrity.

Set it once in config.php, or per tag. Development is unaffected.

Your next build is a tag away.

Download Vitesse, add a few lines to vite.config.js, and put one tag in your layout.