Skip to content

1.1.0

Compare
Choose a tag to compare
@lukaskleinschmidt lukaskleinschmidt released this 19 May 17:27
· 9 commits to main since this release

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',
  ]),
});