mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
chore: handle app.vue fallback
This commit is contained in:
parent
5b2f0fa191
commit
ca8d465073
@ -30,8 +30,7 @@ export async function createApp (builder: Builder, options: Partial<NuxtApp> = {
|
|||||||
// Resolve app.main
|
// Resolve app.main
|
||||||
if (!app.main) {
|
if (!app.main) {
|
||||||
app.main = nuxt.resolver.tryResolvePath('~/App') ||
|
app.main = nuxt.resolver.tryResolvePath('~/App') ||
|
||||||
nuxt.resolver.tryResolvePath('~/app') ||
|
nuxt.resolver.tryResolvePath('~/app')
|
||||||
resolve(nuxt.options.appDir, 'app.vue')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve pages/
|
// Resolve pages/
|
||||||
@ -39,5 +38,12 @@ export async function createApp (builder: Builder, options: Partial<NuxtApp> = {
|
|||||||
app.routes.push(...await resolvePagesRoutes(builder, app))
|
app.routes.push(...await resolvePagesRoutes(builder, app))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fallback app.main
|
||||||
|
if (!app.main && app.routes.length) {
|
||||||
|
app.main = resolve(nuxt.options.appDir, 'app.pages.vue')
|
||||||
|
} else if (!app.main) {
|
||||||
|
app.main = resolve(nuxt.options.appDir, 'app.tutorial.vue')
|
||||||
|
}
|
||||||
|
|
||||||
return app
|
return app
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user