feat(nuxt): extends support for app.vue (#6228)

This commit is contained in:
Kevin Marrec 2022-07-29 13:12:50 +02:00 committed by GitHub
parent 968087bcc5
commit 5a042cd69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,9 @@ export async function generateApp (nuxt: Nuxt, app: NuxtApp) {
export async function resolveApp (nuxt: Nuxt, app: NuxtApp) {
// Resolve main (app.vue)
if (!app.mainComponent) {
app.mainComponent = await findPath(['~/App', '~/app'])
app.mainComponent = await findPath(
nuxt.options._layers.flatMap(layer => [`${layer.config.srcDir}/App`, `${layer.config.srcDir}/app`])
)
}
if (!app.mainComponent) {
app.mainComponent = tryResolveModule('@nuxt/ui-templates/templates/welcome.vue')