mirror of
https://github.com/run-llama/template-workflow-document-qa.git
synced 2026-06-30 21:47:58 -04:00
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:
@@ -11,6 +11,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 ? Number(process.env.PORT) : 3000;
|
||||
const serverPort = process.env.LLAMA_DEPLOY_SERVER_PORT;
|
||||
const baseUrl = process.env.LLAMA_CLOUD_BASE_URL;
|
||||
const apiKey = process.env.LLAMA_CLOUD_API_KEY;
|
||||
|
||||
@@ -24,6 +25,10 @@ export default defineConfig(({}) => {
|
||||
server: {
|
||||
port: port,
|
||||
host: true,
|
||||
hmr: {
|
||||
port: port,
|
||||
clientPort: serverPort ? parseInt(serverPort) : undefined,
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: "dist",
|
||||
|
||||
Reference in New Issue
Block a user