File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,10 @@ TEST_COMFYUI_DIR=/home/ComfyUI
1818
1919# Whether to enable minification of the frontend code.
2020ENABLE_MINIFY=true
21+
22+ # Whether to disable proxying the `/templates` route. If true, allows you to
23+ # serve templates from the ComfyUI_frontend/public/templates folder (for
24+ # locally testing changes to templates). When false or nonexistent, the
25+ # templates are served via the normal method from the server's python site
26+ # packages.
27+ DISABLE_TEMPLATES_PROXY=false
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const IS_DEV = process.env.NODE_ENV === 'development'
1818const SHOULD_MINIFY = process . env . ENABLE_MINIFY === 'true'
1919// vite dev server will listen on all addresses, including LAN and public addresses
2020const VITE_REMOTE_DEV = process . env . VITE_REMOTE_DEV === 'true'
21+ const DISABLE_TEMPLATES_PROXY = process . env . DISABLE_TEMPLATES_PROXY === 'true'
2122
2223const DEV_SERVER_COMFYUI_URL =
2324 process . env . DEV_SERVER_COMFYUI_URL || 'http://127.0.0.1:8188'
@@ -52,9 +53,13 @@ export default defineConfig({
5253 target : DEV_SERVER_COMFYUI_URL
5354 } ,
5455
55- '/templates' : {
56- target : DEV_SERVER_COMFYUI_URL
57- } ,
56+ ...( ! DISABLE_TEMPLATES_PROXY
57+ ? {
58+ '/templates' : {
59+ target : DEV_SERVER_COMFYUI_URL
60+ }
61+ }
62+ : { } ) ,
5863
5964 '/testsubrouteindex' : {
6065 target : 'http://localhost:5173' ,
You can’t perform that action at this time.
0 commit comments