feat: configure next.js build and server-side rendering
This commit is contained in:
@ -3,7 +3,9 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "bun run server.ts",
|
"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": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-polly": "^3.823.0",
|
"@aws-sdk/client-polly": "^3.823.0",
|
||||||
|
10
server.ts
10
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/tts.ts の出力先は ../static/podcast_audio であり、
|
||||||
// services/podcast.ts の出力先は ../public/podcast.xml であることを考慮
|
// services/podcast.ts の出力先は ../public/podcast.xml であることを考慮
|
||||||
const frontendPublicDir = path.join(projectRoot, "frontend", "public");
|
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 podcastAudioDir = path.join(projectRoot, "static", "podcast_audio"); // TTSが音声ファイルを保存する場所
|
||||||
const generalPublicDir = path.join(projectRoot, "public"); // podcast.xml などが置かれる場所
|
const generalPublicDir = path.join(projectRoot, "public"); // podcast.xml などが置かれる場所
|
||||||
|
|
||||||
@ -163,9 +163,11 @@ serve({
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>ポッドキャスト管理画面</title>
|
<title>ポッドキャスト管理画面</title>
|
||||||
<script src="/_next/static/chunks/react.js"></script>
|
<script src="/_next/static/runtime/webpack.js"></script>
|
||||||
<script src="/_next/static/chunks/app.js"></script>
|
<script src="/_next/static/runtime/main.js"></script>
|
||||||
<link rel="stylesheet" href="/_next/static/chunks/app.css" />
|
<script src="/_next/static/runtime/React.js"></script>
|
||||||
|
<script src="/_next/static/runtime/ReactDOM.js"></script>
|
||||||
|
<link rel="stylesheet" href="/_next/static/css/app.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root">${html}</div>
|
<div id="root">${html}</div>
|
||||||
|
Reference in New Issue
Block a user