@@ -134,6 +134,8 @@ export function flatRoutesUniversal(
134
134
let prefixLookup = new PrefixLookupTrie ( ) ;
135
135
let uniqueRoutes = new Map < string , RouteManifestEntry > ( ) ;
136
136
let routeIdConflicts = new Map < string , string [ ] > ( ) ;
137
+ let normalizedApp = normalizeSlashes ( appDirectory ) ;
138
+ let appWithPrefix = path . posix . join ( normalizedApp , prefix ) ;
137
139
138
140
// id -> file
139
141
let routeIds = new Map < string , string > ( ) ;
@@ -142,9 +144,8 @@ export function flatRoutesUniversal(
142
144
let normalizedFile = normalizeSlashes ( file ) ;
143
145
let routeExt = path . extname ( normalizedFile ) ;
144
146
let routeDir = path . dirname ( normalizedFile ) ;
145
- let normalizedApp = normalizeSlashes ( appDirectory ) ;
146
147
let routeId =
147
- routeDir === path . posix . join ( normalizedApp , prefix )
148
+ routeDir === appWithPrefix
148
149
? path . posix
149
150
. relative ( normalizedApp , normalizedFile )
150
151
. slice ( 0 , - routeExt . length )
@@ -174,7 +175,7 @@ export function flatRoutesUniversal(
174
175
let pathname = createRoutePath ( segments , raw , index ) ;
175
176
176
177
routeManifest [ routeId ] = {
177
- file : path . relative ( appDirectory , file ) ,
178
+ file : path . posix . relative ( normalizedApp , file ) ,
178
179
id : routeId ,
179
180
path : pathname ,
180
181
} ;
0 commit comments