diff --git a/packages/astro/src/i18n/vite-plugin-i18n.ts b/packages/astro/src/i18n/vite-plugin-i18n.ts index bf5a0da6e4ebe..47891083899d3 100644 --- a/packages/astro/src/i18n/vite-plugin-i18n.ts +++ b/packages/astro/src/i18n/vite-plugin-i18n.ts @@ -32,14 +32,17 @@ export default function astroInternationalization({ name: 'astro:i18n', enforce: 'pre', config(config) { - const i18nConfig: I18nInternalConfig = { base, format, site, trailingSlash, i18n }; - const finalConfig= { - ...i18nConfig, - isBuild: isCommandBuild + const i18nConfig: I18nInternalConfig = { + base, + format, + site, + trailingSlash, + i18n, + isBuild: isCommandBuild, }; return { define: { - __ASTRO_INTERNAL_I18N_CONFIG__: JSON.stringify(finalConfig), + __ASTRO_INTERNAL_I18N_CONFIG__: JSON.stringify(i18nConfig), }, }; }, diff --git a/packages/astro/src/virtual-modules/i18n.ts b/packages/astro/src/virtual-modules/i18n.ts index 4ee6c33f17396..f710686677872 100644 --- a/packages/astro/src/virtual-modules/i18n.ts +++ b/packages/astro/src/virtual-modules/i18n.ts @@ -2,9 +2,10 @@ import * as I18nInternals from '../i18n/index.js'; import type { I18nInternalConfig } from '../i18n/vite-plugin-i18n.js'; export { normalizeTheLocale, toCodes, toPaths } from '../i18n/index.js'; -// @ts-expect-error -const { trailingSlash, format, domains, site, i18n } = __ASTRO_INTERNAL_I18N_CONFIG__ as I18nInternalConfig; -const { defaultLocale, locales, routing, isBuild } = i18n!; +const { trailingSlash, format, site, i18n, isBuild } = + // @ts-expect-error + __ASTRO_INTERNAL_I18N_CONFIG__ as I18nInternalConfig; +const { defaultLocale, locales, routing, domains } = i18n!; const base = import.meta.env.BASE_URL; export type GetLocaleOptions = I18nInternals.GetLocaleOptions;