fix: use ELECTRON_RENDERER_URL (electron-vite sets this, not VITE_DEV_SERVER_URL)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fyah
2026-05-09 11:33:30 +08:00
parent 8bd977987a
commit 1d459b14e7
2 changed files with 5 additions and 4 deletions

View File

@@ -17,10 +17,10 @@ function createWindow() {
}, },
}) })
if (process.env.VITE_DEV_SERVER_URL) { if (process.env.ELECTRON_RENDERER_URL) {
win.loadURL(process.env.VITE_DEV_SERVER_URL) win.loadURL(process.env.ELECTRON_RENDERER_URL)
} else { } else {
win.loadFile(join(__dirname, '../dist/index.html')) win.loadFile(join(__dirname, '../renderer/index.html'))
} }
} }

View File

@@ -6,6 +6,7 @@
<title>Elec</title> <title>Elec</title>
</head> </head>
<body> <body>
<div style="color: #00ff00; font-size: 24px; padding: 40px;">TEST - IF YOU SEE THIS, HTML IS LOADING</div>
<div id="root"></div> <div id="root"></div>
<script type="module" src="../main.tsx"></script> <script type="module" src="../main.tsx"></script>
</body> </body>