Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

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

Merged
merged 4 commits into from
Jul 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/nuxt/src/core/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ 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'])
for (const config of nuxt.options._layers.map(layer => layer.config)) {
const mainComponent = await findPath([`${config.srcDir}/App`, `${config.srcDir}/app`])
kevinmarrec marked this conversation as resolved.
Show resolved Hide resolved
if (mainComponent) {
app.mainComponent = mainComponent
break
}
}
}
if (!app.mainComponent) {
app.mainComponent = tryResolveModule('@nuxt/ui-templates/templates/welcome.vue')
Expand Down