Skip to content

Commit

Permalink
Add parameter for custom hotfile directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Satrio Wibowo committed Oct 24, 2024
1 parent fb1f6bd commit 60cec46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Commands/stubs/views/master.stub
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />

{{-- Vite CSS --}}
{{-- {{ module_vite('build-$LOWER_NAME$', 'resources/assets/sass/app.scss') }} --}}
{{-- {{ module_vite('build-$LOWER_NAME$', 'resources/assets/sass/app.scss', storage_path('vite.hot')) }} --}}
</head>

<body>
@yield('content')

{{-- Vite JS --}}
{{-- {{ module_vite('build-$LOWER_NAME$', 'resources/assets/js/app.js') }} --}}
{{-- {{ module_vite('build-$LOWER_NAME$', 'resources/assets/js/app.js', storage_path('vite.hot')) }} --}}
</body>
4 changes: 2 additions & 2 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function public_path($path = '')
/**
* support for vite
*/
function module_vite($module, $asset): Vite
function module_vite($module, $asset, $hotFilePath = null): Vite
{
return ViteFacade::useHotFile(storage_path('vite.hot'))->useBuildDirectory($module)->withEntryPoints([$asset]);
return ViteFacade::useHotFile($hotFilePath ?: storage_path('vite.hot'))->useBuildDirectory($module)->withEntryPoints([$asset]);
}
}

0 comments on commit 60cec46

Please sign in to comment.