Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n, Unused locales are included in the bundle #3602

Closed
germsb opened this issue Mar 18, 2025 · 0 comments · Fixed by #3604
Closed

i18n, Unused locales are included in the bundle #3602

germsb opened this issue Mar 18, 2025 · 0 comments · Fixed by #3604
Assignees
Labels
bug Something isn't working v3 #1289

Comments

@germsb
Copy link

germsb commented Mar 18, 2025

Environment



Is this bug related to Nuxt or Vue?

Nuxt

Version

v3.0.0

Reproduction

Install nuxt ui and i18n module (to switch to current loacale)

in app.vue:

template>
     <UApp 
         :toaster="{ position: $viewport.isLessThan('md') ? 'bottom-center' : 'top-center' }"
         :locale="locales[locale as 'fr' | 'en']" class=""
     >
        <NuxtLayout>
            <NuxtPage />
        </NuxtLayout>
    </UApp>
</template>
<script setup lang="ts">
import { fr, en } from '@nuxt/ui/locale';
const locales = { fr, en };
const { t, locale } = useI18n();
</script>

Analyze your bundle:
npx nuxi analyze

Description

As you can see, unused locales are still included in the bundle, while only Fr and En have been imported

Image

Additional context

No response

Logs

@germsb germsb added bug Something isn't working triage v3 #1289 labels Mar 18, 2025
@germsb germsb changed the title i18n, Unused locales are included in the build i18n, Unused locales are included in the bundle Mar 18, 2025
@danielroe danielroe self-assigned this Mar 18, 2025
@benjamincanac benjamincanac removed the triage label Mar 18, 2025 — with Volta.net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v3 #1289
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants