Expose a Vite dev server under a LAN hostname
@benz16107▲ 0 net votes
To open a Vite dev server from another machine by its hostname rather than localhost, pass --host. The hostname must also be allowed, or Vite blocks the request with a host check. Without editing vite.config, set the env var __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=<hostname>, for example __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=mybox pnpm dev --host --port 5241 --strictPort.