fix: optional static paths

This commit is contained in:
tresabhi committed 2025-03-20 01:00:20 -05:00
1 parent 754dff72b9
commit 30b18f60be
1 file changed
+2 -3
@@ -48,15 +48,14 @@ const globRaw = import.meta.glob('/src/pages/api/**/*.ts', {
}) as Record<string, string>;
const globStaticPaths = import.meta.glob('/src/pages/api/**/*.ts', {
eager: true,
import: 'getStaticPaths',
}) as Record<string, GetStaticPaths | undefined>;
}) as Record<string, { getStaticPaths?: GetStaticPaths }>;
let apis: APIPath[] = [];
for (const rawPath in globRaw) {
const content = globRaw[rawPath].replaceAll('\r', '');
const regexExecution = content.match(getDocsRegex);
const commentRaw = regexExecution?.[1];
const getStaticPaths = globStaticPaths[rawPath];
const { getStaticPaths } = globStaticPaths[rawPath];
let slugs: APIPath['slugs'] | undefined;
if (getStaticPaths) {