Download the PHP package viaaurea/vitte without Composer
On this page you can find all versions of the php package viaaurea/vitte. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package vitte
Vitte: Latte-Vite bridge
💿
composer require viaaurea/vitte
Vite bridge for Latte templates (Nette).
🇸🇰/🇨🇿 Slovenská / Česká verzia readme
Usage in Latte:
Supports both Vite's development server and Vite-generated bundles.
Integration with Nette
Decorate Latte\Engine
using ViteLatteInstaller
:
The {vite}
macro is then available in the templates:
The name of the macro is configurable.
Depending on %system.vite.development%
variable (replace it with whatever you are using),
the macro produces tags for production or development:
Vite configuration
Vite (vite.config.js
) must be configured for correct integration:
build.manifest
must be set totrue
build.rollupOptions.input
should point to themain.js
(or other JS entrypoint)
Explanation and more information can be found here:
💡
You may also want to set
build.outDir
to point to a sub folder in the backend's public dir, so that you don't have to move the build files manually after each build.
Compatibility
Compatible with Vite versions v2
, v3
, ... v7
and above.
Please note that the default port for development server has changed since Vite
v3
to5173
from3000
used inv2
.
Latte v2.x
is supported only. Newer Nette versions ship with native support for Vite assets, see nette/assets
package.
Should you be interested in Latte v3 integration, let us know or send a PR.
Cache Warmup
Run this as a build step:
Multiple bundles
Vitte supports multiple Vite bundles (e.g. combining React and Vue bundles),
see the ViteLatteInstaller::bundle()
method.
Usage:
Note that you need to call
ViteLatteInstaller::bundle
for each bundle, like this:\ViteLatteInstaller::bundle(..., 'vue-bundle')::install(@self)