Commit 087b04dc authored by Benjamin Woodruff's avatar Benjamin Woodruff

fix: Add `runtime` field to `MiddlewareConfig` type

parent d796c0f2
import picomatch from 'next/dist/compiled/picomatch' import picomatch from 'next/dist/compiled/picomatch'
import { z } from 'next/dist/compiled/zod' import { z } from 'next/dist/compiled/zod'
import type zod from 'next/dist/compiled/zod'
import { tryToParsePath } from '../../../lib/try-to-parse-path' import { tryToParsePath } from '../../../lib/try-to-parse-path'
import type { RouteHas } from '../../../lib/load-custom-routes' import type { RouteHas } from '../../../lib/load-custom-routes'
...@@ -108,7 +109,9 @@ export const MiddlewareConfigInputSchema = z.object({ ...@@ -108,7 +109,9 @@ export const MiddlewareConfigInputSchema = z.object({
* files. The globs are relative to your application root folder. * files. The globs are relative to your application root folder.
*/ */
unstable_allowDynamic: z.union([GlobSchema, z.array(GlobSchema)]).optional(), unstable_allowDynamic: z.union([GlobSchema, z.array(GlobSchema)]).optional(),
})
runtime: z.union([z.literal('nodejs'), z.literal('edge')]),
}) satisfies zod.ZodType<MiddlewareConfigInput>
export type MiddlewareConfigInput = { export type MiddlewareConfigInput = {
/** /**
...@@ -136,6 +139,8 @@ export type MiddlewareConfigInput = { ...@@ -136,6 +139,8 @@ export type MiddlewareConfigInput = {
* files. The globs are relative to your application root folder. * files. The globs are relative to your application root folder.
*/ */
unstable_allowDynamic?: string | string[] unstable_allowDynamic?: string | string[]
runtime?: 'nodejs' | 'edge'
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment