Skip to content

Commit

Permalink
fix: add 'i18n.bundle.compositionOnly' and 'i18n.types' checking (#2320)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon authored Aug 16, 2023
1 parent 10ec68d commit 28aef69
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ export default defineNuxtModule<NuxtI18nOptions>({
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)

Expand Down

0 comments on commit 28aef69

Please sign in to comment.