Skip to content

Commit 0c73cb7

Browse files
committed
fix(schema): handle backwards compat for dir.app
1 parent dea0b86 commit 0c73cb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/schema/src/config/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ export default defineUntypedSchema({
301301
$resolve: async (val: string | undefined, get) => {
302302
const isV4 = (await get('future') as Record<string, unknown>).compatibilityVersion === 4
303303
if (isV4) {
304-
return resolve(await get('srcDir') as string, val || '.')
304+
const [srcDir, rootDir] = await Promise.all([get('srcDir') as Promise<string>, get('rootDir') as Promise<string>])
305+
return resolve(await get('srcDir') as string, val || (srcDir === rootDir ? 'app' : '.'))
305306
}
306307
return val || 'app'
307308
},

0 commit comments

Comments
 (0)