From 98ac9056c8f140eb659ebd24162d11924fd6f518 Mon Sep 17 00:00:00 2001 From: "Satsuki Akiba (aider)" Date: Wed, 4 Jun 2025 10:11:07 +0900 Subject: [PATCH] feat: configure next.js build and server-side rendering --- package.json | 4 +++- server.ts | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 183f842..ec751d3 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,9 @@ "version": "1.0.0", "scripts": { "start": "bun run server.ts", - "build:frontend": "cd frontend && bun build" + "build:frontend": "cd frontend && bun next build", + "dev:frontend": "cd frontend && bun next dev", + "start:next": "cd frontend && bun next start" }, "dependencies": { "@aws-sdk/client-polly": "^3.823.0", diff --git a/server.ts b/server.ts index 19071c1..52db5e6 100644 --- a/server.ts +++ b/server.ts @@ -24,7 +24,7 @@ await db.exec(fs.readFileSync(path.join(projectRoot, "schema.sql"), "utf-8")); // services/tts.ts の出力先は ../static/podcast_audio であり、 // services/podcast.ts の出力先は ../public/podcast.xml であることを考慮 const frontendPublicDir = path.join(projectRoot, "frontend", "public"); -const frontendBuildDir = path.join(projectRoot, "frontend", "build"); // Reactアプリのビルド出力先 +const frontendBuildDir = path.join(projectRoot, "frontend", ".next"); // Next.jsアプリのビルド出力先 const podcastAudioDir = path.join(projectRoot, "static", "podcast_audio"); // TTSが音声ファイルを保存する場所 const generalPublicDir = path.join(projectRoot, "public"); // podcast.xml などが置かれる場所 @@ -163,9 +163,11 @@ serve({ ポッドキャスト管理画面 - - - + + + + +
${html}