The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 07:15 UTC
| 1 | import { defineCloudflareConfig, type OpenNextConfig } from "@opennextjs/cloudflare"; |
| 2 | import staticAssetsCache from "@opennextjs/cloudflare/overrides/incremental-cache/static-assets-incremental-cache"; |
| 3 | |
| 4 | const handlerPaths = ["/api/config"]; |
| 5 | |
| 6 | export const buildCommand = |
| 7 | "npx next build && node -e \"require('node:fs').writeFileSync('../native-build-marker', 'native');\""; |
| 8 | |
| 9 | const config: OpenNextConfig = { |
| 10 | ...defineCloudflareConfig({ incrementalCache: staticAssetsCache }), |
| 11 | appPath: "native-output", |
| 12 | buildOutputPath: "native-output", |
| 13 | packageJsonPath: "native-output/package.json", |
| 14 | buildCommand, |
| 15 | dangerous: { |
| 16 | headersAndCookiesPriority: (event) => |
| 17 | handlerPaths.some((prefix) => event.rawPath.startsWith(prefix)) ? "handler" : "middleware", |
| 18 | }, |
| 19 | }; |
| 20 | |
| 21 | export default config; |