Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 6d0a49b

Browse files
committed
feat: add initial configuration files for Open Next with Cloudflare support
- Created next.config.ts to set up Next.js configuration and enable Cloudflare context for development. - Added open-next.config.ts to define Cloudflare-specific configurations, including optional R2 caching. - Initialized wrangler.jsonc for Cloudflare Workers configuration, including compatibility settings and asset bindings.
1 parent 437048e commit 6d0a49b

7 files changed

Lines changed: 24105 additions & 4914 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ pids
1515
*.pid
1616
*.seed
1717
*.pid.lock
18+
.open-next
19+
.vscode
20+
.dev.vars
1821

1922
# Directory for instrumented libs generated by jscoverage/JSCover
2023
lib-cov

cloudflare-env.d.ts

Lines changed: 8372 additions & 0 deletions
Large diffs are not rendered by default.

next.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
/* config options here */
5+
};
6+
7+
export default nextConfig;
8+
9+
// added by create cloudflare to enable calling `getCloudflareContext()` in `next dev`
10+
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
11+
initOpenNextCloudflareForDev();

open-next.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
2+
3+
export default defineCloudflareConfig({
4+
// Uncomment to enable R2 cache,
5+
// It should be imported as:
6+
// `import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";`
7+
// See https://opennext.js.org/cloudflare/caching for more details
8+
// incrementalCache: r2IncrementalCache,
9+
});

0 commit comments

Comments
 (0)