From 461efaf4fb8f604f8feef3f1e1bf99853fda258c Mon Sep 17 00:00:00 2001 From: Bobbie Goede Date: Sun, 1 Oct 2023 14:41:39 +0200 Subject: [PATCH] fix: not loading `vueI18n` config from a nested path (#2460) --- .../fixtures/vue_i18n_options/{ => config}/vue-i18n.options.ts | 0 specs/vue_i18n_custom_options.spec.ts | 2 +- src/utils.ts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename specs/fixtures/vue_i18n_options/{ => config}/vue-i18n.options.ts (100%) diff --git a/specs/fixtures/vue_i18n_options/vue-i18n.options.ts b/specs/fixtures/vue_i18n_options/config/vue-i18n.options.ts similarity index 100% rename from specs/fixtures/vue_i18n_options/vue-i18n.options.ts rename to specs/fixtures/vue_i18n_options/config/vue-i18n.options.ts diff --git a/specs/vue_i18n_custom_options.spec.ts b/specs/vue_i18n_custom_options.spec.ts index f5d639f5a..3c92114ac 100644 --- a/specs/vue_i18n_custom_options.spec.ts +++ b/specs/vue_i18n_custom_options.spec.ts @@ -9,7 +9,7 @@ await setup({ // overrides nuxtConfig: { i18n: { - vueI18n: './vue-i18n.options.ts' + vueI18n: './config/vue-i18n.options.ts' } } }) diff --git a/src/utils.ts b/src/utils.ts index 34692a016..ba14f3e42 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -250,7 +250,7 @@ export async function resolveVueI18nConfigInfo(options: NuxtI18nOptions, buildDi const absolutePath = await resolvePath(configPathInfo.relative, { cwd: rootDir, extensions: EXECUTABLE_EXTENSIONS }) if (await isExists(absolutePath)) { const parsed = parsePath(absolutePath) - const loadPath = join(configPathInfo.relativeBase, parsed.base) + const loadPath = join(configPathInfo.relativeBase, relative(rootDir, absolutePath)) configPathInfo.absolute = absolutePath configPathInfo.type = getLocaleType(absolutePath)