mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt): resolve modules relative to modulesDir (#21082)
This commit is contained in:
parent
92bc999d0e
commit
6eacad03b8
@ -68,7 +68,7 @@ export async function resolveApp (nuxt: Nuxt, app: NuxtApp) {
|
||||
)
|
||||
}
|
||||
if (!app.mainComponent) {
|
||||
app.mainComponent = (await tryResolveModule('@nuxt/ui-templates/templates/welcome.vue'))!
|
||||
app.mainComponent = (await tryResolveModule('@nuxt/ui-templates/templates/welcome.vue', nuxt.options.modulesDir))!
|
||||
}
|
||||
|
||||
// Resolve root component
|
||||
|
@ -190,7 +190,7 @@ async function initNuxt (nuxt: Nuxt) {
|
||||
addComponent({
|
||||
name: 'NuxtWelcome',
|
||||
priority: 10, // built-in that we do not expect the user to override
|
||||
filePath: (await tryResolveModule('@nuxt/ui-templates/templates/welcome.vue'))!
|
||||
filePath: (await tryResolveModule('@nuxt/ui-templates/templates/welcome.vue', nuxt.options.modulesDir))!
|
||||
})
|
||||
|
||||
addComponent({
|
||||
|
@ -50,7 +50,7 @@ export default defineNuxtModule({
|
||||
// Opt-out feature allowing dependencies using @vueuse/head to work
|
||||
if (nuxt.options.experimental.polyfillVueUseHead) {
|
||||
// backwards compatibility
|
||||
nuxt.options.alias['@vueuse/head'] = await tryResolveModule('@unhead/vue') || '@unhead/vue'
|
||||
nuxt.options.alias['@vueuse/head'] = await tryResolveModule('@unhead/vue', nuxt.options.modulesDir) || '@unhead/vue'
|
||||
addPlugin({ src: resolve(runtimeDir, 'plugins/vueuse-head-polyfill') })
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user