@@ -402,13 +402,12 @@ export async function generator(config: Config, root: string) {
402
402
} else {
403
403
routeTree . push ( node )
404
404
}
405
-
406
- if ( node . children && node . children . length > 0 ) {
407
- node . isNonPath = updateIsNonPath ( node )
408
- }
409
-
410
- if ( node . parent ) {
411
- node . parent . isNonPath = updateIsNonPath ( node . parent )
405
+ if (
406
+ node . _fsRouteType === 'layout' &&
407
+ node . isVirtual &&
408
+ node . isVirtualParentRoute
409
+ ) {
410
+ node . isNonPath = node . children ?. every ( ( d ) => d . isNonPath )
412
411
}
413
412
414
413
routeNodes . push ( node )
@@ -845,9 +844,7 @@ function removeGroups(s: string) {
845
844
function determineNodePath ( node : RouteNode ) {
846
845
return ( node . path = node . parent
847
846
? node . routePath ?. replace (
848
- node . parent . _fsRouteType === 'pathless_layout'
849
- ? ( node . parent . path ?? '' )
850
- : ( node . parent . routePath ?? '' ) ,
847
+ node . parent . isNonPath ? '' : ( node . parent . routePath ?? '' ) ,
851
848
'' ,
852
849
) || '/'
853
850
: node . routePath )
@@ -1108,18 +1105,3 @@ export function startAPIRouteSegmentsFromTSRFilePath(
1108
1105
1109
1106
return segments
1110
1107
}
1111
-
1112
- /**
1113
- * Only true if all children are pathless_layout or
1114
- * if children are of different types but all their children are pathless_layout
1115
- * @param node
1116
- * @returns
1117
- */
1118
- export const updateIsNonPath = ( node : RouteNode ) => {
1119
- if ( node . _fsRouteType === 'pathless_layout' ) return true
1120
- return node . children ?. every (
1121
- ( child ) =>
1122
- child . _fsRouteType === 'pathless_layout' ||
1123
- ( child . children ?. length && child . isNonPath ) ,
1124
- )
1125
- }
0 commit comments