bryaneschultz / vite-manifest-plugin
Twig utility function to handle Vite manifest asset files for Craft CMS.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:craft-plugin
Requires
- php: ^8.0.2
- craftcms/cms: ^4.0.0
README
Requirements
This plugin requires Craft CMS 4.x or later.
Installation
1. Install with Composer
From the terminal
cd /path/to/project
composer require bryaneschultz/vite-manifest-plugin
2. Install through Craft CMS
In the Control Panel, go to Settings
→ Plugins
→ Vite Manifest
→ Install
Vite Manifest Overview
Lightweight Twig utility function to handle Vite Manifest files for Craft CMS.
Configuring Vite Manifest
Vite Manifest comes with basic configuration. To override these configuration keys,
copy the contents of the config.php
file to config/vite-manifest.php
[
'webRootAlias' => '@webroot',
'manifestFile' => 'manifest.json',
'viteDist' => 'dist',
]
Using Vite Manifest
Basic Usage.
By default, Vite Manifest will use the version supplied by the manifest.
<link rel="stylesheet" href="{{ manifest('css/app.css') }}" />
<script src="{{ manifest('js/app.ts') }}"></script>
Advanced Usage.
If you want twig to handle the html for your asset, pass true
as a second parameter.
{{ manifest('css/app.scss', true) }}
{{ manifest('js/app.ts', true) }}
License
Vite Manifest is open-sourced software licensed under the MIT license.
Vite Manifest Roadmap
Brought to you by Bryan E. Schultz