mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
fix(schema): handle backwards compat for dir.app
This commit is contained in:
parent
dea0b86c7c
commit
0c73cb7346
@ -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