Skip to content

Releases: lukaskleinschmidt/kirby-laravel-vite

2.1.3

05 Mar 07:56
e6102c9
Compare
Choose a tag to compare

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

10 Nov 18:19
5e27d7d
Compare
Choose a tag to compare

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

09 Sep 16:24
2aec5dd
Compare
Choose a tag to compare

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

05 Sep 15:55
ad08ae9
Compare
Choose a tag to compare

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

04 Aug 15:01
1679a70
Compare
Choose a tag to compare

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

13 Jul 09:25
545a4aa
Compare
Choose a tag to compare
  • Added missing type definition 545a4aa

1.1.2

06 Jul 14:20
Compare
Choose a tag to compare

Note
Options should be defined with the key lukaskleinschmidt.laravel-vite instead of lukaskleinschmidt.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

31 May 11:49
2f36397
Compare
Choose a tag to compare

Fixed #2

1.1.0

19 May 17:27
Compare
Choose a tag to compare

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

13 Mar 10:21
Compare
Choose a tag to compare