fix(electron): always proxy UI dev server for CLI in dev

This commit is contained in:
Shantur Rathore
2026-02-10 10:38:47 +00:00
parent 0511d92cbf
commit ee9da95044
2 changed files with 7 additions and 3 deletions

View File

@@ -399,8 +399,11 @@ async function exchangeBootstrapToken(baseUrl: string, token: string): Promise<b
async function startCli() { async function startCli() {
try { try {
const devMode = // In desktop dev workflows we always want the CLI to run in dev mode so it:
!app.isPackaged && Boolean(process.env.VITE_DEV_SERVER_URL || process.env.ELECTRON_RENDERER_URL || process.env.NODE_ENV === "development") // - uses plain HTTP
// - proxies UI requests to the renderer dev server
// Monaco's AMD assets are served from that dev server.
const devMode = !app.isPackaged
console.info("[cli] start requested (dev mode:", devMode, ")") console.info("[cli] start requested (dev mode:", devMode, ")")
await cliManager.start({ dev: devMode }) await cliManager.start({ dev: devMode })
} catch (error) { } catch (error) {

View File

@@ -390,7 +390,8 @@ export class CliProcessManager extends EventEmitter {
} }
if (options.dev) { if (options.dev) {
args.push("--ui-dev-server", "http://localhost:3000", "--log-level", "debug") const devServer = process.env.VITE_DEV_SERVER_URL || process.env.ELECTRON_RENDERER_URL || "http://localhost:3000"
args.push("--ui-dev-server", devServer, "--log-level", "debug")
} }
return args return args