mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 21:23:07 +00:00
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:
@@ -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] || '/');
|
||||
|
||||
Reference in New Issue
Block a user