mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
fix: optional static paths
This commit is contained in:
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) {
|
||||
|
||||
Reference in new issue
Block a user