Skip to content

Commit 21a8f96

Browse files
committed
Migrate to OpenNext
1 parent ed412b2 commit 21a8f96

11 files changed

Lines changed: 20917 additions & 6557 deletions

File tree

.dev.vars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXTJS_ENV=development

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ next-env.d.ts
4444
/public/sw.js
4545
/public/workbox-*.js
4646
/public/fallback-*.js
47+
48+
.open-next
49+
.wrangler

app/[locale]/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ import type {
4545
VideoPlayerProps,
4646
} from "@/components/video-player";
4747

48-
export const runtime = "edge";
49-
5048
const VideoPlayer = dynamic<VideoPlayerProps>(
5149
() => import("@/components/video-player"),
5250
{

app/robots.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import type { MetadataRoute } from "next";
22

3-
export const runtime = "edge";
4-
53
export default function robots(): MetadataRoute.Robots {
64
return {
75
rules: {

app/sitemap.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import type { MetadataRoute } from "next";
22
import { locales, localeConfig } from "@/lib/locales";
33

4-
export const runtime = "edge";
5-
64
export default function sitemap(): MetadataRoute.Sitemap {
75
const baseUrl = "https://subtitle-editor.org";
86

next.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import type { NextConfig } from "next";
2+
import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";
13
import createNextIntlPlugin from "next-intl/plugin";
24
import runtimeCaching from "next-pwa/cache";
35
import withPWAInit from "next-pwa";
4-
import type { NextConfig } from "next";
56

67
const withNextIntl = createNextIntlPlugin();
78
const withPWA = withPWAInit({
@@ -22,4 +23,9 @@ const nextConfig: NextConfig = {
2223
reactCompiler: true,
2324
};
2425

26+
if (process.env.NODE_ENV === "development") {
27+
// Allow `next dev` to expose local Cloudflare bindings (KV/R2/etc.)
28+
initOpenNextCloudflareForDev();
29+
}
30+
2531
export default withPWA(withNextIntl(nextConfig));

open-next.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
2+
import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";
3+
4+
export default defineCloudflareConfig({
5+
incrementalCache: r2IncrementalCache,
6+
});

0 commit comments

Comments
 (0)