runningUnitTests()) { return static::resolveFromManifest($entry); } if (is_file(public_path('hot'))) { return Vite::asset($entry); } return static::resolveFromManifest($entry); } private static function resolveFromManifest(string $entry): ?string { $manifest = public_path('build/manifest.json'); if (! is_file($manifest)) { return null; } /** @var array|null $decoded */ $decoded = json_decode((string) file_get_contents($manifest), true); if (! is_array($decoded)) { return null; } $file = $decoded[$entry]['file'] ?? null; if (! is_string($file) || $file === '') { return null; } return asset('build/'.$file); } }