Skip to content

Commit 374eca7

Browse files
committed
Fix index gen
1 parent b505c7f commit 374eca7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

codegen/lib/connect.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ export const connect = (
4141
setRouteLayoutContext(file, namespace, blueprint)
4242

4343
const parentPath = namespace.parentPath ?? ''
44+
routeIndexes[parentPath] ??= new Set()
4445
routeIndexes[parentPath]?.add(`${kebabCase(namespace.name)}.js`)
4546
routeIndexes[parentPath]?.add(`${kebabCase(namespace.name)}/index.js`)
4647

47-
const pathParts = parentPath.split('/')
48+
const pathParts = namespace.path.split('/')
4849
while (pathParts.length > 1) {
4950
const name = pathParts.pop()
5051
if (name == null) throw new Error('Unexpected null')

0 commit comments

Comments
 (0)