Configure Cloudflare Workers deployment with OpenNext#15
Merged
Conversation
- Add @opennextjs/cloudflare to transform Next.js build for Workers - Create wrangler.jsonc with worker entry-point and assets config - Create open-next.config.ts required by opennextjs-cloudflare - Update build script to run opennextjs-cloudflare build after next build - Enable turbopackUseSystemTlsCerts to fix Google Fonts fetch in CI https://claude.ai/code/session_01NGazKnE99CMZKFvoPTFPnf
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Cloudflare Workers deployment configuration to the project, enabling the Next.js application to be built and deployed as a Cloudflare Worker using OpenNext.
Key Changes
wrangler.jsonc: Cloudflare Workers configuration file specifying the worker name, compatibility settings, entry point (.open-next/worker.js), and static asset handlingopen-next.config.ts: OpenNext configuration file for Cloudflare deployment using the@opennextjs/cloudflareadapterpackage.jsonbuild command to run both Next.js build and OpenNext Cloudflare build (next build && opennextjs-cloudflare build)@opennextjs/cloudflarev1.19.10 as a dev dependencyturbopackUseSystemTlsCerts: trueto experimental settings for proper TLS certificate handling in the build environmentImplementation Details
The configuration uses Node.js compatibility mode (
nodejs_compatflag) to ensure Node.js APIs are available in the Cloudflare Worker environment. Static assets are served through Cloudflare's asset binding system, and the worker entry point is generated by OpenNext during the build process.https://claude.ai/code/session_01NGazKnE99CMZKFvoPTFPnf