From fff7de8184b92d3c33c40838c566b2f0313cac44 Mon Sep 17 00:00:00 2001 From: "Satsuki Akiba (aider)" Date: Wed, 4 Jun 2025 11:08:33 +0900 Subject: [PATCH] refactor: fix index.html path and vite config for correct build --- frontend/vite.config.ts | 1 + server.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index ad0a407..1b8af44 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -12,4 +12,5 @@ export default defineConfig({ input: "index.html", }, }, + root: ".", // index.html を frontend ディレクトリ直下に置いている前提 }); diff --git a/server.ts b/server.ts index 3e8fd44..37277d6 100644 --- a/server.ts +++ b/server.ts @@ -120,7 +120,7 @@ app.get("/", async (c) => { // フォールバックとして index.html(明示的なパス) app.get("/index.html", async (c) => { - const indexPath = path.join(frontendBuildDir, "server", "app", "index.html"); + const indexPath = path.join(frontendBuildDir, "index.html"); const file = Bun.file(indexPath); if (await file.exists()) { console.log(`Serving index.html from ${indexPath}`); @@ -132,7 +132,7 @@ app.get("/index.html", async (c) => { // その他のパスも index.html へフォールバック app.get("*", async (c) => { - const indexPath = path.join(frontendBuildDir, "server", "app", "index.html"); + const indexPath = path.join(frontendBuildDir, "index.html"); const file = Bun.file(indexPath); if (await file.exists()) { console.log(`Serving index.html from ${indexPath}`);