Skip to content

Commit 60cec46

Browse files
author
Muhammad Satrio Wibowo
committed
Add parameter for custom hotfile directory
1 parent fb1f6bd commit 60cec46

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Commands/stubs/views/master.stub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
1919

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

2424
<body>
2525
@yield('content')
2626

2727
{{-- Vite JS --}}
28-
{{-- {{ module_vite('build-$LOWER_NAME$', 'resources/assets/js/app.js') }} --}}
28+
{{-- {{ module_vite('build-$LOWER_NAME$', 'resources/assets/js/app.js', storage_path('vite.hot')) }} --}}
2929
</body>

src/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ function public_path($path = '')
4242
/**
4343
* support for vite
4444
*/
45-
function module_vite($module, $asset): Vite
45+
function module_vite($module, $asset, $hotFilePath = null): Vite
4646
{
47-
return ViteFacade::useHotFile(storage_path('vite.hot'))->useBuildDirectory($module)->withEntryPoints([$asset]);
47+
return ViteFacade::useHotFile($hotFilePath ?: storage_path('vite.hot'))->useBuildDirectory($module)->withEntryPoints([$asset]);
4848
}
4949
}

0 commit comments

Comments
 (0)