fix web ui in electron

pull/17803/head
Brendan Allan 2026-03-27 13:07:33 +08:00
parent da38da0add
commit b797a14857
No known key found for this signature in database
GPG Key ID: 41E835AEA046A32E
3 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,8 @@ import pkg from "electron-updater"
import contextMenu from "electron-context-menu"
contextMenu({ showSaveImageAs: true, showLookUpSelection: false, showSearchWithGoogle: false })
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

@ -66,6 +66,9 @@ await Bun.build({
OPENCODE_MIGRATIONS: JSON.stringify(migrations),
OPENCODE_CHANNEL: `'${Script.channel}'`,
},
files: {
"opencode-web-ui.gen.ts": "",
},
})
console.log("Build complete")