mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
MDX: Fix windows compatibility
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-mdx': patch
|
||||
---
|
||||
|
||||
Fix windows compatibility
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as path from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import { build } from 'esbuild';
|
||||
import { validateConfig } from '@/config/validate';
|
||||
import { type Collections } from '@/config/define';
|
||||
@@ -43,9 +44,10 @@ export async function loadConfig(configPath: string): Promise<LoadedConfig> {
|
||||
throw new Error('failed to compile configuration file');
|
||||
}
|
||||
|
||||
const url = pathToFileURL(outputPath);
|
||||
const [err, config] = validateConfig(
|
||||
// every call to `loadConfig` will cause the previous cache to be ignored
|
||||
(await import(`${outputPath}?hash=${Date.now().toString()}`)) as Record<
|
||||
(await import(`${url.toString()}?hash=${Date.now().toString()}`)) as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
|
||||
Reference in New Issue
Block a user