mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
21 lines
570 B
TypeScript
21 lines
570 B
TypeScript
import type { Config } from '@react-router/dev/config';
|
|
import fs from 'node:fs/promises';
|
|
import type { Info } from './scripts/generate-info';
|
|
|
|
export default {
|
|
ssr: true,
|
|
async prerender({ getStaticPaths }) {
|
|
const info: Info = JSON.parse(await fs.readFile('.react-router/_info', 'utf-8'));
|
|
|
|
const paths: string[] = [];
|
|
for (const path of getStaticPaths()) {
|
|
// ignore dynamic document search
|
|
if (path === '/api/search') continue;
|
|
paths.push(path);
|
|
}
|
|
|
|
paths.push(...info.prerender);
|
|
return paths;
|
|
},
|
|
} satisfies Config;
|