diff --git a/src/Commands/stubs/views/master.stub b/src/Commands/stubs/views/master.stub index 8fa6ac498..d1347bd0c 100644 --- a/src/Commands/stubs/views/master.stub +++ b/src/Commands/stubs/views/master.stub @@ -18,12 +18,12 @@ {{-- 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')) }} --}} @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')) }} --}} diff --git a/src/helpers.php b/src/helpers.php index 8d39f267e..8798fa6ea 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -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]); } }