Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Is it possible to control vercel runtime via env variable? #6825

Closed Locked Answered by versecafe
derek-cove asked this question in Feature Question
Discussion options

You must be logged in to vote

@derek-cove Yep the way would be to modify the route.ts files, and then next build, you could do something like a bun script that parses app/**/route.ts and then some string parsing maybe have a comment like

// #[EnvSetRuntime]
//

which would get modified into

// #[EnvSetRuntime]
export const runtime = "edge";

Or

// #[EnvSetRuntime]
export const runtime = "nodejs";

And then run next build, after the build step completes parse back over and convert all instances ike

// #[EnvSetRuntime]
export const runtime = "nodejs";

back into

// #[EnvSetRuntime]
//

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@versecafe
Comment options

Answer selected by derek-cove
@derek-cove
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants