mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-22 20:05:23 +00:00
fix: pin desktop renderer dev server to loopback
This commit is contained in:
@@ -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),
|
||||
},
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user