fix(schema): use v3 folder structure if app.vue exists in rootDir

This commit is contained in:
Daniel Roe 2024-05-03 12:34:12 +01:00
parent 8958f7ca70
commit 1af81ed0fb
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -105,6 +105,11 @@ export default defineUntypedSchema({
const srcDir = resolve(rootDir, 'app')
if (!existsSync(srcDir)) {
for (const file of ['app.vue', 'App.vue']) {
if (existsSync(resolve(rootDir, file))) {
return rootDir
}
}
const keys = ['assets', 'layouts', 'middleware', 'pages', 'plugins'] as const
const dirs = await Promise.all(keys.map(key => get(`dir.${key}`) as Promise<string>))
for (const dir of dirs) {