fix web ui in electron

This commit is contained in:
Brendan Allan
2026-03-27 13:07:33 +08:00
parent 6073a630c8
commit 6a28a5f63c
3 changed files with 7 additions and 1 deletions

View File

@@ -8,6 +8,8 @@ import type { Event } from "electron"
import { app, BrowserWindow, dialog } from "electron"
import pkg from "electron-updater"
process.env.OPENCODE_DISABLE_EMBEDDED_WEB_UI = "true"
const APP_NAMES: Record<string, string> = {
dev: "OpenCode Dev",
beta: "OpenCode Beta",

View File

@@ -1,4 +1,4 @@
import { Server } from "virtual:opencode-server"
import { Server, Log } from "virtual:opencode-server"
import { DEFAULT_SERVER_URL_KEY, WSL_ENABLED_KEY } from "./constants"
import { store } from "./store"
@@ -30,6 +30,7 @@ export function setWslConfig(config: WslConfig) {
}
export async function spawnLocalServer(hostname: string, port: number, password: string) {
await Log.init({ level: "WARN" })
const listener = await Server.listen({
port,
hostname,

View File

@@ -64,6 +64,9 @@ await Bun.build({
define: {
OPENCODE_MIGRATIONS: JSON.stringify(migrations),
},
files: {
"opencode-web-ui.gen.ts": "",
},
})
console.log("Build complete")