Skip to content

Commit

Permalink
Fixed regression
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaskleinschmidt committed Jul 6, 2023
1 parent ca43f6b commit 4b63221
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ If you need to include additional attributes on your script and style tags, such

```php
return [
'lukaskleinschmidt.kirby-laravel-vite' => [
'lukaskleinschmidt.laravel-vite' => [
'scriptTagAttributes' => [
'data-turbo-track' => 'reload', // Specify a value for the attribute...
'async' => true, // Specify an attribute without a value...
Expand All @@ -186,7 +186,7 @@ If you need to conditionally add attributes, you may pass a callback that will r

```php
return [
'lukaskleinschmidt.kirby-laravel-vite' => [
'lukaskleinschmidt.laravel-vite' => [
'scriptTagAttributes' => fn (string $src, string $url, array $chunk, array $manifest) => [
'data-turbo-track' => $src === 'assets/js/app.js' ? 'reload' : false,
],
Expand All @@ -207,7 +207,7 @@ To enable additional customization options, you can use the following options:

```php
return [
'lukaskleinschmidt.kirby-laravel-vite' => [
'lukaskleinschmidt.laravel-vite' => [
'hotFile' => fn () => kirby()->root('storage') . '/vite.hot',
'buildDirectory' => 'bundle',
'manifest' => 'assets.json',
Expand Down
5 changes: 3 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
'hooks' => [
'system.loadPlugins:after' => function () use ($options) {
foreach ($options as $key => $defaultValue) {
$value = option('lukaskleinschmidt.kirby-laravel-vite.' . $key);
$method = 'use' . ucfirst($key);
$value = option('lukaskleinschmidt.kirby-laravel-vite.' . $key);
$value ??= option('lukaskleinschmidt.laravel-vite.' . $key);
$method = 'use' . ucfirst($key);

if (is_null($defaultValue) && is_callable($value)) {
$value = $value(kirby());
Expand Down

0 comments on commit 4b63221

Please sign in to comment.