File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
packages/runtime/src/templates Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import {
12
12
localizeRoute ,
13
13
localizeDataRoute ,
14
14
unlocalizeRoute ,
15
- joinPaths ,
16
15
} from './handlerUtils'
17
16
18
17
interface NetlifyConfig {
@@ -78,12 +77,11 @@ const getNetlifyNextServer = (NextServer: NextServerType) => {
78
77
// doing what they do in https://github.com/vercel/vercel/blob/1663db7ca34d3dd99b57994f801fb30b72fbd2f3/packages/next/src/server-build.ts#L576-L580
79
78
private netlifyPrebundleReact ( path : string ) {
80
79
const routesManifest = this . getRoutesManifest ?.( )
81
- const appPathsManifest = this . getAppPathsManifest ?.( )
80
+ const appPathsRoutes = this . getAppPathRoutes ?.( )
82
81
83
82
const routes = routesManifest && [ ...routesManifest . staticRoutes , ...routesManifest . dynamicRoutes ]
84
- const matchedRoute = routes ?. find ( ( route ) => new RegExp ( route . regex ) . test ( path . split ( '?' ) [ 0 ] ) )
85
- const isAppRoute =
86
- appPathsManifest && matchedRoute ? appPathsManifest [ joinPaths ( matchedRoute . page , 'page' ) ] : false
83
+ const matchedRoute = routes ?. find ( ( route ) => new RegExp ( route . regex ) . test ( new URL ( path , 'http://n' ) . pathname ) )
84
+ const isAppRoute = appPathsRoutes && matchedRoute ? appPathsRoutes [ matchedRoute . page ] : false
87
85
88
86
if ( isAppRoute ) {
89
87
// app routes should use prebundled React
You can’t perform that action at this time.
0 commit comments