MDX: Fix non-absolute dir option

This commit is contained in:
Fuma Nama
2024-10-29 14:36:47 +08:00
parent 823822f274
commit 164b9e6d84
4 changed files with 8 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-mdx': patch
---
Fix non-absolute `dir` option
+1 -1
View File
@@ -52,7 +52,7 @@ Configure Fumadocs MDX by creating a `source.config.ts` file.
import { defineDocs } from 'fumadocs-mdx/config';
export const { docs, meta } = defineDocs({
dir: '/content/docs',
dir: 'content/docs',
});
```
+1 -1
View File
@@ -133,7 +133,7 @@ export function defineDocs<
/**
* The directory to scan files
*
* @defaultValue '/content/docs'
* @defaultValue 'content/docs'
*/
dir?: string | string[];
+1 -1
View File
@@ -86,7 +86,7 @@ async function getCollectionFiles(
await Promise.all(
dirs.map(async (dir) => {
const result = await fg(collection.files ?? '**/*', {
cwd: dir,
cwd: path.resolve(dir),
absolute: true,
});