Skip to content

2.0.0

Compare
Choose a tag to compare
@lukaskleinschmidt lukaskleinschmidt released this 04 Aug 15:01
· 4 commits to main since this release
1679a70

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