File tree Expand file tree Collapse file tree 2 files changed +1
-17
lines changed
packages/open-next/src/core Expand file tree Collapse file tree 2 files changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ export function getMiddlewareMatch(
150150 middlewareManifest : MiddlewareManifest ,
151151 functionsManifest ?: FunctionsConfigManifest ,
152152) {
153- if ( functionsManifest ) {
153+ if ( functionsManifest ?. functions ?. [ "/_middleware" ] ) {
154154 return (
155155 functionsManifest . functions [ "/_middleware" ] . matchers ?. map (
156156 ( { regexp } ) => new RegExp ( regexp ) ,
Original file line number Diff line number Diff line change 1- import fs from "node:fs" ;
2- import path from "node:path" ;
3-
41import {
52 AppPathsManifestKeys ,
63 NextConfig ,
74 RoutesManifest ,
85} from "config/index.js" ;
96// @ts -ignore
107import NextServer from "next/dist/server/next-server.js" ;
11- import type { MiddlewareManifest } from "types/next-types.js" ;
128
139import { debug } from "../adapters/logger.js" ;
1410import {
@@ -63,18 +59,6 @@ export const requestHandler = new NextServer.default({
6359 dir : __dirname ,
6460} ) . getRequestHandler ( ) ;
6561
66- export function getMiddlewareMatch ( middlewareManifest : MiddlewareManifest ) {
67- const rootMiddleware = middlewareManifest . middleware [ "/" ] ;
68- if ( ! rootMiddleware ?. matchers ) return [ ] ;
69- return rootMiddleware . matchers . map ( ( { regexp } ) => new RegExp ( regexp ) ) ;
70- }
71-
72- export function loadMiddlewareManifest ( nextDir : string ) {
73- const filePath = path . join ( nextDir , "server" , "middleware-manifest.json" ) ;
74- const json = fs . readFileSync ( filePath , "utf-8" ) ;
75- return JSON . parse ( json ) as MiddlewareManifest ;
76- }
77-
7862//#override setNextjsPrebundledReact
7963export function setNextjsPrebundledReact ( rawPath : string ) {
8064 // WORKAROUND: Set `__NEXT_PRIVATE_PREBUNDLED_REACT` to use prebundled React
You can’t perform that action at this time.
0 commit comments