Configure Vite HMR client port via environment variable (#201)

* feat: add LLAMA_DEPLOY_SERVER_PORT HMR clientPort to template vite configs

Set hmr.clientPort to LLAMA_DEPLOY_SERVER_PORT when defined, enabling
Vite HMR websocket connections to work through the server proxy.

https://claude.ai/code/session_01Hq5ZQxquwtyJVJ2qw48bbt

* feat: add LLAMA_DEPLOY_SERVER_PORT HMR support to template vite configs

Add hmr.port and hmr.clientPort to all template vite configs so that
Vite HMR websocket connections work through the server proxy. When
LLAMA_DEPLOY_SERVER_PORT is set, clientPort directs the browser's HMR
websocket to connect via the proxy server port.

Bump patch versions for all affected templates.

https://claude.ai/code/session_01Hq5ZQxquwtyJVJ2qw48bbt

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Adrian Lyjak
2026-01-27 17:58:46 -05:00
committed by GitHub
parent dc6a335e6f
commit b5d688dd72
+2
View File
@@ -8,6 +8,7 @@ export default defineConfig(({}) => {
const basePath = process.env.LLAMA_DEPLOY_DEPLOYMENT_BASE_PATH;
const projectId = process.env.LLAMA_DEPLOY_PROJECT_ID;
const port = process.env.PORT;
const serverPort = process.env.LLAMA_DEPLOY_SERVER_PORT;
return {
plugins: [react()],
resolve: {
@@ -20,6 +21,7 @@ export default defineConfig(({}) => {
host: true,
hmr: {
port: port ? parseInt(port) : undefined,
clientPort: serverPort ? parseInt(serverPort) : undefined,
},
},
build: {