fix: pin desktop renderer dev server to loopback

This commit is contained in:
LukeParkerDev
2026-04-17 10:56:15 +10:00
parent 3b1970a0f4
commit 66dfdb933d
2 changed files with 10 additions and 1 deletions

View File

@@ -60,6 +60,13 @@ export default defineConfig({
plugins: [appPlugin],
publicDir: "../../../app/public",
root: "src/renderer",
server: {
host: "127.0.0.1",
strictPort: true,
hmr: {
host: "127.0.0.1",
},
},
define: {
"import.meta.env.VITE_OPENCODE_CHANNEL": JSON.stringify(channel),
},

View File

@@ -134,7 +134,9 @@ export function createLoadingWindow(globals: Globals) {
function loadWindow(win: BrowserWindow, html: string) {
const devUrl = process.env.ELECTRON_RENDERER_URL
if (devUrl) {
const url = new URL(html, devUrl)
const base = new URL(devUrl)
if (base.hostname === "localhost") base.hostname = "127.0.0.1"
const url = new URL(html, base)
void win.loadURL(url.toString())
return
}