Make dev server target configurable (#79)

This commit is contained in:
Chenlei Hu
2024-07-02 12:26:14 -04:00
committed by GitHub
parent da4f48c9be
commit 38fdd19e5a
2 changed files with 10 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
import { defineConfig, Plugin } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy'
import path from 'path';
import dotenv from "dotenv";
dotenv.config();
const IS_DEV = process.env.NODE_ENV === 'development';
@@ -80,7 +82,7 @@ export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8188',
target: process.env.DEV_SERVER_COMFYUI_URL || 'http://127.0.0.1:8188',
// Return empty array for extensions API as these modules
// are not on vite's dev server.
bypass: (req, res, options) => {