How can I change the runtime (edge / nodejs) based on a build time environment variable?
Unanswered
Bohemian Waxwing posted this in #help-forum
Bohemian WaxwingOP
Hey 👋 I'm trying to test deploy an application both on Cloudflare and Vercel to compare the 2. To deploy on Cloudflare I need to have
It looks like the following doens't work:
Any idea on how to change the
export const runtime = 'edge' but because of a bug between the edge runtime and the middleware (https://github.com/vercel/next.js/issues/48295), I don't want to use the edge runtime on Vercel for now.It looks like the following doens't work:
export const runtime = process.env.CLOUDFLARE ? 'edge' : 'nodejs';Any idea on how to change the
runtime for all routes at build time?