From d514c675cf0cecd314b8b6c189161cdad1220efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=20=D0=A1=D1=82=D0=BE=D0=BB=D0=B1?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Tue, 29 Jul 2025 19:44:21 +0300 Subject: [PATCH] Add compatibility with Nuxt 4 --- package.json | 2 +- src/module.ts | 4 ++-- src/runtime/composables/use-external-font.ts | 2 +- src/runtime/composables/use-local-font.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index eef82c5..6143ba5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuxt-font-loader", - "version": "2.3.5", + "version": "2.3.6", "description": "Simple, modern and lightweight font loader for Nuxt.", "author": "Ivo Dolenc", "license": "MIT", diff --git a/src/module.ts b/src/module.ts index 3d9f171..b4bf1e4 100644 --- a/src/module.ts +++ b/src/module.ts @@ -59,7 +59,7 @@ export default defineNuxtModule({ } } - head.style?.push({ children: styles }) + head.style?.push(styles) } if (external) { @@ -111,7 +111,7 @@ export default defineNuxtModule({ ) } - if (styles) head.style?.push({ children: styles }) + if (styles) head.style?.push(styles) } }, }) diff --git a/src/runtime/composables/use-external-font.ts b/src/runtime/composables/use-external-font.ts index bdc2c75..c2982cf 100644 --- a/src/runtime/composables/use-external-font.ts +++ b/src/runtime/composables/use-external-font.ts @@ -54,5 +54,5 @@ export const useExternalFont = (external: ExternalOptions[]) => { useHead({ link: links }) - if (styles) return useHead({ style: [{ children: styles }] }) + if (styles) return useHead({ style: [styles] }) } diff --git a/src/runtime/composables/use-local-font.ts b/src/runtime/composables/use-local-font.ts index 075266a..03a8f50 100644 --- a/src/runtime/composables/use-local-font.ts +++ b/src/runtime/composables/use-local-font.ts @@ -31,5 +31,5 @@ export const useLocalFont = (local: LocalOptions[]) => { if (links.length) useHead({ link: links }) - return useHead({ style: [{ children: styles }] }) + return useHead({ style: [styles] }) }