From 28aef6902556c2948a81100e553f90fc3e6dd518 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Wed, 16 Aug 2023 19:01:54 +0900 Subject: [PATCH] fix: add 'i18n.bundle.compositionOnly' and 'i18n.types' checking (#2320) --- src/module.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/module.ts b/src/module.ts index d93921a7a..cd2c3be51 100644 --- a/src/module.ts +++ b/src/module.ts @@ -93,6 +93,20 @@ export default defineNuxtModule({ throw new Error(formatMessage(`Cannot support nuxt version: ${getNuxtVersion(nuxt)}`)) } + /** + * Check conflicting options + */ + + if (options.bundle.compositionOnly && options.types === 'legacy') { + throw new Error( + formatMessage( + `'i18n.bundle.compositionOnly' option and 'i18n.types' option is conflicting: i18n.bundle.compositionOnly: ${ + options.bundle.compositionOnly + }, i18n.types: ${JSON.stringify(options.types)}` + ) + ) + } + applyLayerOptions(options, nuxt) await mergeI18nModules(options, nuxt)