diff --git a/packages/nuxt/src/core/templates.ts b/packages/nuxt/src/core/templates.ts index ea9a380521..7b1845cb4a 100644 --- a/packages/nuxt/src/core/templates.ts +++ b/packages/nuxt/src/core/templates.ts @@ -226,7 +226,7 @@ export const schemaTemplate: NuxtTemplate = { ` [${configKey}]${options.unresolved ? '?' : ''}: typeof ${genDynamicImport(importName, { wrapper: false })}.default extends NuxtModule ? ${options.unresolved ? 'Partial' : 'O'} : Record`, ] }), - modules.length > 0 && options.unresolved ? ` modules?: (undefined | null | false | NuxtModule | string | [NuxtModule | string, Record] | ${modules.map(([configKey, importName, mod]) => `[${genString(mod.meta?.rawPath || importName)}, Exclude]`).join(' | ')})[],` : '', + modules.length > 0 && options.unresolved ? ` modules?: (undefined | null | false | NuxtModule | string | [NuxtModule | string, Record] | ${modules.map(([configKey, importName, mod]) => `[${genString(mod.meta?.rawPath || importName)}, Exclude]`).join(' | ')})[],` : '', ].filter(Boolean) return [ diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index aa668b95ed..61fcd1f2a5 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -295,7 +295,7 @@ export default defineUntypedSchema({ * function () {} * ] * ``` - * @type {(typeof import('../src/types/module').NuxtModule | string | [typeof import('../src/types/module').NuxtModule | string, Record] | undefined | null | false)[]} + * @type {(typeof import('../src/types/module').NuxtModule | string | [typeof import('../src/types/module').NuxtModule | string, Record] | undefined | null | false)[]} */ modules: { $resolve: (val: string[] | undefined): string[] => (val || []).filter(Boolean),