From ebd20ccc3edd3abf71e8c88f7a150d85b85ab84e Mon Sep 17 00:00:00 2001 From: chauncey <23046078+ellermister@users.noreply.github.com> Date: Sat, 9 Mar 2024 17:52:05 +0800 Subject: [PATCH] Update Vite.php Fixed automatic replacement of domain names accessed by clients for vite hot --- src/Illuminate/Foundation/Vite.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Vite.php b/src/Illuminate/Foundation/Vite.php index a81ca1616b96..68a79802b06f 100644 --- a/src/Illuminate/Foundation/Vite.php +++ b/src/Illuminate/Foundation/Vite.php @@ -652,7 +652,9 @@ public function reactRefresh() */ protected function hotAsset($asset) { - return rtrim(file_get_contents($this->hotFile())).'/'.$asset; + $hotURL = parse_url(file_get_contents($this->hotFile())); + $hotURLNew = str_replace('//' . $hotURL['host'], '//' . app(Request::class)->getHost(), file_get_contents($this->hotFile())); + return rtrim($hotURLNew) . '/' . $asset; } /**