Allow disabling proxy of /template path via env (#3773)

This commit is contained in:
Christian Byrne
2025-05-05 17:48:11 -07:00
committed by GitHub
parent 13b00cdbc6
commit f52915a590
2 changed files with 15 additions and 3 deletions

View File

@@ -18,6 +18,7 @@ const IS_DEV = process.env.NODE_ENV === 'development'
const SHOULD_MINIFY = process.env.ENABLE_MINIFY === 'true'
// vite dev server will listen on all addresses, including LAN and public addresses
const VITE_REMOTE_DEV = process.env.VITE_REMOTE_DEV === 'true'
const DISABLE_TEMPLATES_PROXY = process.env.DISABLE_TEMPLATES_PROXY === 'true'
const DEV_SERVER_COMFYUI_URL =
process.env.DEV_SERVER_COMFYUI_URL || 'http://127.0.0.1:8188'
@@ -52,9 +53,13 @@ export default defineConfig({
target: DEV_SERVER_COMFYUI_URL
},
'/templates': {
target: DEV_SERVER_COMFYUI_URL
},
...(!DISABLE_TEMPLATES_PROXY
? {
'/templates': {
target: DEV_SERVER_COMFYUI_URL
}
}
: {}),
'/testsubrouteindex': {
target: 'http://localhost:5173',