fix: Correct __dirname paths for Vite bundled electron modules

Vite bundles all electron modules into a single main.js file,
so __dirname remains apps/ui/dist-electron regardless of source
file location. Updated path comments to clarify this behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shirone
2026-01-25 20:49:53 +01:00
parent 615823652c
commit d7ad87bd1b
4 changed files with 17 additions and 13 deletions

View File

@@ -37,7 +37,8 @@ const CONTENT_TYPES: Record<string, string> = {
* Uses centralized electronApp methods for serving static files from app bundle.
*/
export async function startStaticServer(): Promise<void> {
const staticPath = path.join(__dirname, '../../dist');
// __dirname is apps/ui/dist-electron (Vite bundles all into single file)
const staticPath = path.join(__dirname, '../dist');
state.staticServer = http.createServer((request, response) => {
let filePath = path.join(staticPath, request.url?.split('?')[0] || '/');