{{-- Asset loading tanpa @vite() helper. Kita baca manifest.json langsung agar tidak bergantung pada path convention Laravel. Saat dev: Vite hot file ada di public/hot → load dari dev server. Saat prod: baca manifest.json → inject CSS + JS. --}} @php $viteHot = public_path('hot'); $manifestFile = public_path('build/manifest.json'); @endphp @if (file_exists($viteHot)) {{-- Dev mode: Vite dev server aktif --}} @php $devUrl = rtrim(file_get_contents($viteHot), "\n"); $viteClient = $devUrl . '/@vite/client'; $viteEntry = $devUrl . '/main.ts'; @endphp @elseif (file_exists($manifestFile)) {{-- Production mode: load dari build manifest --}} @php $manifest = json_decode(file_get_contents($manifestFile), true); $entry = $manifest['main.ts'] ?? null; @endphp @if ($entry) @foreach ($entry['css'] ?? [] as $css) @endforeach @endif @else
⚠ Assets not found. Run: npm run build or npm run dev