We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4da27e4 commit b505c7fCopy full SHA for b505c7f
1 file changed
codegen/lib/connect.ts
@@ -41,10 +41,17 @@ export const connect = (
41
setRouteLayoutContext(file, namespace, blueprint)
42
43
const parentPath = namespace.parentPath ?? ''
44
-
45
- routeIndexes[parentPath] ??= new Set()
46
routeIndexes[parentPath]?.add(`${kebabCase(namespace.name)}.js`)
47
routeIndexes[parentPath]?.add(`${kebabCase(namespace.name)}/index.js`)
+
+ const pathParts = parentPath.split('/')
48
+ while (pathParts.length > 1) {
49
+ const name = pathParts.pop()
50
+ if (name == null) throw new Error('Unexpected null')
51
+ const path = toFilePath(`/${pathParts.join('/')}`)
52
+ routeIndexes[path] ??= new Set()
53
+ routeIndexes[path]?.add(`${kebabCase(name)}/index.js`)
54
+ }
55
}
56
57
for (const route of routes) {
0 commit comments