From 46499f704994efff4da810baaaa3d61d56b66083 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 21 Jan 2025 17:13:35 +1100 Subject: [PATCH] chore: export from app --- packages/nuxt/src/head/module.ts | 4 ---- packages/nuxt/src/head/runtime/exports.ts | 2 +- packages/nuxt/src/imports/presets.ts | 4 ++++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nuxt/src/head/module.ts b/packages/nuxt/src/head/module.ts index 8432adda3e..be0edf37be 100644 --- a/packages/nuxt/src/head/module.ts +++ b/packages/nuxt/src/head/module.ts @@ -41,10 +41,6 @@ export default defineNuxtModule({ const exportPath = resolve(runtimeDir, 'exports', isNuxtV4 ? 'v4' : 'v3') nuxt.options.alias['#unhead/exports'] = exportPath - addImportsSources({ - from: '#app', - imports: unheadVueComposablesImports['@unhead/vue'], - }) // for Nuxt v3 users we will alias `@unhead/vue` to our custom export path so that // import { useHead } from '@unhead/vue' diff --git a/packages/nuxt/src/head/runtime/exports.ts b/packages/nuxt/src/head/runtime/exports.ts index 02e69d41c4..b0a94cef9a 100644 --- a/packages/nuxt/src/head/runtime/exports.ts +++ b/packages/nuxt/src/head/runtime/exports.ts @@ -6,7 +6,7 @@ export { useServerHead, useServerHeadSafe, useServerSeoMeta, -} from '#app' +} from '#app/composables/head' export { createHeadCore, diff --git a/packages/nuxt/src/imports/presets.ts b/packages/nuxt/src/imports/presets.ts index 40a6e557f1..8abf88a90f 100644 --- a/packages/nuxt/src/imports/presets.ts +++ b/packages/nuxt/src/imports/presets.ts @@ -113,6 +113,10 @@ const granularAppPresets: InlinePreset[] = [ imports: ['useRuntimeHook'], from: '#app/composables/runtime-hook', }, + { + imports: ['useHead', 'useHeadSafe', 'useServerHeadSafe', 'useServerHead', 'useSeoMeta', 'useServerSeoMeta', 'injectHead'], + from: '#app/composables/head', + }, ] export const scriptsStubsPreset = {