Skip to content

Commit ad7a391

Browse files
JuulapsJuul
authored andcommitted
fix: support passing options to init open-next cloudflare dev function
1 parent ac8dd81 commit ad7a391

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/cloudflare/src/api/cloudflare-context.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,13 @@ async function getCloudflareContextAsync<
208208
* with the open-next Cloudflare adapter
209209
*
210210
* Note: this function should only be called inside the Next.js config file, and although async it doesn't need to be `await`ed
211+
* @param options options how the function should operate and if/where to persist the platform data
211212
*/
212-
export async function initOpenNextCloudflareForDev() {
213+
export async function initOpenNextCloudflareForDev(options?: Omit<GetPlatformProxyOptions, "environment">) {
213214
const shouldInitializationRun = shouldContextInitializationRun();
214215
if (!shouldInitializationRun) return;
215216

216-
const context = await getCloudflareContextFromWrangler();
217+
const context = await getCloudflareContextFromWrangler(options);
217218

218219
addCloudflareContextToNodejsGlobal(context);
219220

0 commit comments

Comments
 (0)