mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
27 lines
735 B
TypeScript
27 lines
735 B
TypeScript
import type { Config } from '@react-router/dev/config';
|
|
import { glob } from 'node:fs/promises';
|
|
import { createGetUrl, getSlugs } from 'fumadocs-core/source';
|
|
|
|
const getUrl = createGetUrl('/docs');
|
|
|
|
export default {
|
|
ssr: false,
|
|
future: {
|
|
v8_middleware: true,
|
|
},
|
|
async prerender({ getStaticPaths }) {
|
|
const paths: string[] = [];
|
|
const excluded: string[] = [];
|
|
|
|
for (const path of getStaticPaths()) {
|
|
if (!excluded.includes(path)) paths.push(path);
|
|
}
|
|
|
|
for await (const entry of glob('**/*.mdx', { cwd: 'content/docs' })) {
|
|
const slugs = getSlugs(entry);
|
|
paths.push(getUrl(slugs), `/llms.mdx/docs/${[...slugs, 'content.md'].join('/')}`);
|
|
}
|
|
|
|
return paths;
|
|
},
|
|
} satisfies Config; |