Skip to content

Commit 7d836b8

Browse files
feat: support finding source file when index of folder
1 parent 2eba019 commit 7d836b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/runtime/src/helpers/files.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ export const getSourceFileForPage = (page: string, roots: string[], pageExtensio
353353
if (existsSync(file)) {
354354
return file
355355
}
356+
357+
const fileAtFolderIndex = join(root, page, `index.${extension}`)
358+
if (existsSync(fileAtFolderIndex)) {
359+
return fileAtFolderIndex
360+
}
356361
}
357362
}
358363
console.log('Could not find source file for page', page)

0 commit comments

Comments
 (0)