File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/cloudflare/src/api Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11import type { Context , RunningCodeOptions } from "node:vm" ;
22
3+ import type { GetPlatformProxyOptions } from "wrangler" ;
4+
35declare global {
46 interface CloudflareEnv {
57 NEXT_CACHE_WORKERS_KV ?: KVNamespace ;
@@ -250,12 +252,13 @@ async function monkeyPatchVmModuleEdgeContext(cloudflareContext: CloudflareConte
250252async function getCloudflareContextFromWrangler <
251253 CfProperties extends Record < string , unknown > = IncomingRequestCfProperties ,
252254 Context = ExecutionContext ,
253- > ( ) : Promise < CloudflareContext < CfProperties , Context > > {
255+ > ( options ?: Omit < GetPlatformProxyOptions , "environment" > ) : Promise < CloudflareContext < CfProperties , Context > > {
254256 // Note: we never want wrangler to be bundled in the Next.js app, that's why the import below looks like it does
255257 const { getPlatformProxy } = await import ( /* webpackIgnore: true */ `${ "__wrangler" . replaceAll ( "_" , "" ) } ` ) ;
256258 const { env, cf, ctx } = await getPlatformProxy ( {
257259 // This allows the selection of a wrangler environment while running in next dev mode
258260 environment : process . env . NEXT_DEV_WRANGLER_ENV ,
261+ ...options ,
259262 } ) ;
260263 return {
261264 env,
You can’t perform that action at this time.
0 commit comments