Hot Reload

Hot Module Replacement and Refreshing on Save

npm 2,036 run dev starts Vite 25,978 's development server, and the plugin writes its URL to public/hot. When that file exists, @vite points at the dev server instead of the manifest:

Output of 61
$ npm run dev -- --port 5307 &
  VITE v8.3.0  ready in 402 ms
...
$ cat public/hot; echo
http://127.0.0.1:5307
$ curl -s http://127.0.0.1:8307/shop | grep -o '\(src\|href\)="http://127.0.0.1:5307/[@r][^"]*"
  '
src="http://127.0.0.1:5307/@vite/client"
href="http://127.0.0.1:5307/resources/css/app.css"
src="http://127.0.0.1:5307/resources/js/app.js"

/@vite/client keeps a WebSocket open to Vite, which compiles files on request (app.css arrives as a text/javascript module that injects the styles). Saving the view, then the CSS:

Output of 61
3:52:59 PM [vite] full reload resources/views/shop.blade.php
3:53:01 PM [vite] (client) hmr update /resources/css/app.css

CSS and JavaScript are hot-swapped in place, keeping page state. Blade has no module in the browser, so refresh: true reloads the page when resources/views, routes, lang or app/Livewire change. Stopping Vite deletes public/hot (after a crash, delete it yourself). composer run dev runs php artisan dev, which starts serve, queue:listen, pail and npm run dev together. Where file events never arrive (Docker 514 , a VM, /mnt/c under WSL 6 ), set server.watch.usePolling.