mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 14:22:28 +08:00
[Feature] Add Cloudflare Worker as deployment option (#170)
* docs(cloudflare): add detailed Cloudflare Workers + R2 deploy guide * separated cloudflare deploy guide from readme.md * Missing R2 bucket binding for incremental cache * docs: move Cloudflare guide to docs/ and improve documentation - Move Cloudflare_Deploy.md to docs/ folder - Add 'Deploy without R2' option for simple/free deployments - Add workers.dev subdomain registration instructions - Add missing global_fetch_strictly_public flag - Add troubleshooting for common deployment issues - Update README.md link to new location * fix: conditional import for cloudflare dev and regenerate lockfile - Use dynamic import for @opennextjs/cloudflare to avoid loading workerd during builds - Regenerate package-lock.json with cross-platform dependencies * fix: use main lockfile with cloudflare deps added - Use main branch's package-lock.json as base to ensure cross-platform deps - Add @opennextjs/cloudflare and wrangler --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com>
This commit is contained in:
@@ -17,3 +17,13 @@ const nextConfig: NextConfig = {
|
||||
}
|
||||
|
||||
export default nextConfig
|
||||
|
||||
// Initialize OpenNext Cloudflare for local development only
|
||||
// This must be a dynamic import to avoid loading workerd binary during builds
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
import("@opennextjs/cloudflare").then(
|
||||
({ initOpenNextCloudflareForDev }) => {
|
||||
initOpenNextCloudflareForDev()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user