mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
fix(schema): handle backwards compat for dir.app
This commit is contained in:
parent
6dcbf7e3f7
commit
a0d5145095
@ -301,7 +301,8 @@ export default defineUntypedSchema({
|
||||
$resolve: async (val: string | undefined, get) => {
|
||||
const isV4 = (await get('future') as Record<string, unknown>).compatibilityVersion === 4
|
||||
if (isV4) {
|
||||
return resolve(await get('srcDir') as string, val || '.')
|
||||
const [srcDir, rootDir] = await Promise.all([get('srcDir') as Promise<string>, get('rootDir') as Promise<string>])
|
||||
return resolve(await get('srcDir') as string, val || (srcDir === rootDir ? 'app' : '.'))
|
||||
}
|
||||
return val || 'app'
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user