@props([
'css' => 'resources/css/app.css',
'js' => 'resources/js/app.js',
'analytics' => 'resources/js/analytics-boot.js',
])
@php
$hot = file_exists(public_path('hot'));
$manifestPath = public_path('build/manifest.json');
$manifest = (! $hot && file_exists($manifestPath))
? json_decode(file_get_contents($manifestPath), true)
: [];
$alpineChunk = collect($manifest)->first(
fn ($entry, $key) => ($entry['name'] ?? null) === 'alpine' || str_starts_with((string) $key, '_alpine-')
);
@endphp
@if ($hot)
@vite([$css, $js, $analytics])
@else
@php $cssUrl = Illuminate\Support\Facades\Vite::asset($css); @endphp
@if ($alpineChunk)
@endif
@push('scripts')
@endpush
@endif