From e5492fe12c71afa6ed878c43def0f3d99a0392c3 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 21 Jan 2025 17:48:00 +1100 Subject: [PATCH] chore: broken alias --- packages/nuxt/src/head/module.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/nuxt/src/head/module.ts b/packages/nuxt/src/head/module.ts index 4ae286e04e..cb41b7bb2c 100644 --- a/packages/nuxt/src/head/module.ts +++ b/packages/nuxt/src/head/module.ts @@ -34,15 +34,14 @@ export default defineNuxtModule({ ] } - const realUnheadPath = await tryResolveModule('@unhead/vue', nuxt.options.modulesDir) || '@unhead/vue' - // Transpile @unhead/vue - nuxt.options.build.transpile.push(realUnheadPath) - // for Nuxt v3 users we will alias `@unhead/vue` to our custom export path so that // import { useHead } from '@unhead/vue' // will work in a context without the Vue app such as Nuxt plugins and such // for Nuxt v4 user should import from #imports if (!isNuxtV4) { + const realUnheadPath = await tryResolveModule('@unhead/vue', nuxt.options.modulesDir) || '@unhead/vue' + // Transpile @unhead/vue + nuxt.options.build.transpile.push(realUnheadPath) for (const subpath of ['legacy', 'types']) { nuxt.options.alias[`@unhead/vue/${subpath}`] = resolve(dirname(realUnheadPath), subpath) }