Skip to content

Commit

Permalink
chore: Cloudflareにデプロイするためのセットアップ
Browse files Browse the repository at this point in the history
  • Loading branch information
namidapoo committed Dec 25, 2024
1 parent 2787c43 commit 52ef7d9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Image from "next/image";

export const runtime = "edge";

export default function Home() {
return (
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
Expand Down
Binary file modified bun.lockb
Binary file not shown.
13 changes: 10 additions & 3 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { setupDevPlatform } from "@cloudflare/next-on-pages/next-dev";
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
const createConfig = async (): Promise<NextConfig> => {
if (process.env.NODE_ENV === "development") {
await setupDevPlatform();
}
const nextConfig: NextConfig = {
/* config options here */
};
return nextConfig;
};

export default nextConfig;
export default createConfig();
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"lint": "bunx biome lint ./",
"check": "bunx biome check --write ./",
"type-check": "tsc --noEmit",
"type-check:watch": "tsc --noEmit --watch"
"type-check:watch": "tsc --noEmit --watch",
"pages:build": "bunx @cloudflare/next-on-pages",
"preview": "bun pages:build && wrangler pages dev",
"deploy": "bun pages:build && wrangler pages deploy"
},
"dependencies": {
"class-variance-authority": "^0.7.1",
Expand All @@ -26,12 +29,14 @@
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@cloudflare/next-on-pages": "^1.13.7",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"lefthook": "^1.10.0",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
"typescript": "^5",
"wrangler": "^3.99.0"
}
}
4 changes: 4 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "dev-recap"
compatibility_date = "2024-12-25"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = ".vercel/output/static"

0 comments on commit 52ef7d9

Please sign in to comment.