Closed dannystarkDE closed 9 months ago
You need to expose the vite
function to be available in your templates https://github.com/wearejust/kirby-twig/blob/master/doc/functions.md#exposing-a-function.
Something like:
// config/config.php
return [
'wearejust.twig.env.functions' => [
'vite' => 'vite'
]
];
And in your template:
{{ vite().js('path/to/app.js')|raw }}
Note that I added |raw
at the end because Twig escapes strings by default.
Hope it helps!
Thank you very much. That works!
Does anyone use the plugin in combination with Vite?
I use the basic installation of https://github.com/arnoson/kirby-vite-basic-kit. However, all I get from Twig is the message "Unknown "vite" function. Did you mean "site"?".
I would appreciate any help.