diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index 152a76a3ca..aebb01b081 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -301,7 +301,8 @@ export default defineUntypedSchema({ $resolve: async (val: string | undefined, get) => { const isV4 = (await get('future') as Record).compatibilityVersion === 4 if (isV4) { - return resolve(await get('srcDir') as string, val || '.') + const [srcDir, rootDir] = await Promise.all([get('srcDir') as Promise, get('rootDir') as Promise]) + return resolve(await get('srcDir') as string, val || (srcDir === rootDir ? 'app' : '.')) } return val || 'app' },