Releases: lukaskleinschmidt/kirby-laravel-vite
2.1.3
Vite 5 Support
- Fixed the CSS resolver
In Vite 5 CSS files are no longer listed as top level entries in the manifest.json.
Full Changelog: 2.1.2...2.1.3
2.1.2
Bugfix
- Fixed an issue where the
$chunk
variable was overwritten leading to missing css files - Improved the logic that checks whether an optional asset exists or not
Full Changelog: 2.1.1...2.1.2
2.1.1
Fixed Custom Panel Scripts And Styles Regression
Fixed a regressions that impacted panel CSS and JS. The bug was introduced in 2.0.0.
The vite(array|string $entries = null)
helper function will now return a copy of the current vite instance if you pass in any entries.
This change prevents entries from being overwritten when you define both panel CSS and JS. This is the intended behavior outside of custom panel assets anyway.
Full Changelog: 2.1.0...2.1.1
2.1.0
Vite loves CDN
Vite now uses the url()
helper instead of the asset()
helper to generate URLs.
This change makes CDN implementations like Kirby loves CDN work.
Full Changelog: 2.0.0...2.1.0
2.0.0
Removed forced vite copy
Prior to this update the vite()
helper function always returned a copy of the global vite instance.
This meant that you were able to configure Vite directly in the template without changing the global configuration.
If you relied on that you can still do it but you have to manually create a copy of the global instance.
<!doctype html>
<head>
<?=
vite()->copy()->useHotFile($kirby->root('storage') . '/vite.hot')
->useBuildDirectory('bundle')
->useManifest('assets.json')
->withEntries(['assets/js/app.js'])
?>
</head>
The reason for this change is to improve performance when using Vite to handle assets.
If you use many assets in your templates the overhead of the previous implementation was not worth the initial benefit it gave.
<img src="<?= vite()->asset('assets/images/logo.png') ?>">
In general most people probably only needed one Vite instance and not multiple to begin with.
So unless you are actually using multiple Vite instances you won't need to change anything.
Full Changelog: 1.1.3...2.0.0
1.1.3
1.1.2
Note
Options should be defined with the keylukaskleinschmidt.laravel-vite
instead oflukaskleinschmidt.kirby-laravel-vite
.
The plugin handles the mismatch gracefully. However, I recommend that you update any of your custom configurations.
Thanks @tobimori for finding the chunk lookup bug in the first place 🙂
1.1.1
1.1.0
Custom Panel Scripts And Styles
You can use vite for your panel.css
or panel.js
too. Since the plugin requires the Kirby instance to work you need to define the assets in the ready callback to be able to use the vite()
helper.
return [
'ready' => fn () => [
'panel' => [
'css' => vite('assets/css/panel.css'),
'js' => vite([
'assets/js/feature.js',
'assets/js/panel.js',
]),
],
]
];
Note
Remember to include the optional panel assets in vite as well so that they are actually available once bundled.
Assets not included in vite will work in development mode but not when bundled.
export default defineConfig({
laravel([
'assets/css/panel.css',
'assets/js/feature.js',
'assets/js/panel.js',
]),
});
1.0.3
- Fix for composer version problem
https://getcomposer.org/doc/04-schema.md#version