From c807932605006e6228c4c3f69f0bfff22a664ffe Mon Sep 17 00:00:00 2001 From: skiyee <319619193@qq.com> Date: Wed, 10 Sep 2025 21:43:02 +0800 Subject: [PATCH] fix: normalize source cwd --- src/utils/source.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/source.ts b/src/utils/source.ts index 9a94b7fb9..41c4ec01b 100644 --- a/src/utils/source.ts +++ b/src/utils/source.ts @@ -1,5 +1,5 @@ import { readFile } from 'node:fs/promises' -import { join } from 'pathe' +import { join, normalize } from 'pathe' import { withLeadingSlash, withoutTrailingSlash } from 'ufo' import { glob } from 'tinyglobby' import type { CollectionSource, ResolvedCollectionSource } from '../types/collection' @@ -25,7 +25,7 @@ export function defineLocalSource(source: CollectionSource | ResolvedCollectionS prefix: withoutTrailingSlash(withLeadingSlash(fixed)), prepare: async ({ rootDir }) => { resolvedSource.cwd = source.cwd - ? String(source.cwd).replace(/^~~\//, rootDir) + ? String(normalize(source.cwd)).replace(/^~~\//, rootDir) : join(rootDir, 'content') }, getKeys: async () => {