From 98218945328b947e6c2a75f03b89c27e401dc6d5 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 17 Feb 2025 15:22:07 +0100 Subject: [PATCH] fix(module): use key when merging modules options --- src/module.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/module.ts b/src/module.ts index 39da285c..9168ec4a 100644 --- a/src/module.ts +++ b/src/module.ts @@ -96,20 +96,20 @@ export default defineNuxtModule({ nuxt.options.postcss.plugins['@tailwindcss/postcss'] = {} } - async function registerModule(name: string, options: Record) { + async function registerModule(name: string, key: string, options: Record) { if (!hasNuxtModule(name)) { await installModule(name, options) } else { - (nuxt.options as any)[name] = defu((nuxt.options as any)[name], options) + (nuxt.options as any)[key] = defu((nuxt.options as any)[key], options) } } - await registerModule('@nuxt/icon', { cssLayer: 'components' }) + await registerModule('@nuxt/icon', 'icon', { cssLayer: 'components' }) if (options.fonts) { - await registerModule('@nuxt/fonts', { experimental: { processCSSVariables: true } }) + await registerModule('@nuxt/fonts', 'fonts', { experimental: { processCSSVariables: true } }) } if (options.colorMode) { - await registerModule('@nuxtjs/color-mode', { classSuffix: '', disableTransition: true }) + await registerModule('@nuxtjs/color-mode', 'colorMode', { classSuffix: '', disableTransition: true }) } addPlugin({ src: resolve('./runtime/plugins/colors') })