-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathopen-next.config.ts
More file actions
29 lines (25 loc) · 1.02 KB
/
open-next.config.ts
File metadata and controls
29 lines (25 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { defineCloudflareConfig } from '@opennextjs/cloudflare';
import r2IncrementalCache from '@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache';
import { withRegionalCache } from '@opennextjs/cloudflare/overrides/incremental-cache/regional-cache';
import doQueue from '@opennextjs/cloudflare/overrides/queue/do-queue';
import type { OpenNextConfig } from '@opennextjs/cloudflare';
const cloudflareConfig = defineCloudflareConfig({
/**
* The regional cache implementation with R2 (instead of a KV one) is is chosen here
* for both R2's strong consistency alongside the regional cache performance gains.
* @see https://opennext.js.org/cloudflare/caching
*/
incrementalCache: withRegionalCache(r2IncrementalCache, {
mode: 'long-lived',
}),
queue: doQueue,
enableCacheInterception: true,
});
const openNextConfig: OpenNextConfig = {
...cloudflareConfig,
buildCommand: 'pnpm build --webpack',
cloudflare: {
skewProtection: { enabled: true },
},
};
export default openNextConfig;