MDX: hotfix Windows path escape

This commit is contained in:
Fuma Nama
2025-12-16 22:55:41 +08:00
parent ab34c56494
commit adaf9aec22
3 changed files with 8 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-mdx': patch
---
hotfix Windows path escape
+2 -2
View File
@@ -5,7 +5,7 @@ import type {
MetaCollectionItem,
} from '@/config/build';
import path from 'path';
import { type CodeGen, createCodegen, ident } from '@/utils/codegen';
import { type CodeGen, createCodegen, ident, slash } from '@/utils/codegen';
import { glob } from 'tinyglobby';
import { createFSCache } from '@/utils/fs-cache';
import { createHash } from 'crypto';
@@ -377,7 +377,7 @@ async function generateBrowserIndexFile(ctx: FileGenContext) {
}
function getBase(collection: CollectionItem) {
return path.relative(process.cwd(), collection.dir);
return slash(path.relative(process.cwd(), collection.dir));
}
function generateDocCollectionFrontmatterGlob(
+1 -1
View File
@@ -42,7 +42,7 @@ export async function dynamic<Config, TC extends InternalTypeConfig>(
function convertLazyEntries(
collection: DocCollectionItem,
entries: LazyEntry<unknown>[],
entries: LazyEntry[],
) {
const head: Record<string, () => unknown> = {};
const body: Record<string, () => Promise<unknown>> = {};