Skip to content

Unused locales are included in the bundle #5034

@ExEr7um

Description

@ExEr7um

Environment

  • Operating System: Darwin
  • Node Version: v24.8.0
  • Nuxt Version: 4.1.2
  • CLI Version: 3.28.0
  • Nitro Version: 2.12.6
  • Package Manager: pnpm@10.16.1
  • Builder: -
  • User Config: modules, devtools, css, routeRules, compatibilityDate, eslint
  • Runtime Modules: @nuxt/eslint@1.9.0, @nuxt/ui@4.0.0-alpha.2
  • Build Modules: -

Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.0.0-alpha.x

Version

v4.0.0-alpha.2

Reproduction

https://github.com/ExEr7um/nuxt-ui-rolldown-locales-treeshake

Description

Unused locales are included in the bundle when using Rolldown. If I disable it, then only imported locales are present. Related to #3602.

Reproduction

Locales are imported in app.vue file like this:

import { en as nuxtUiEn, ru as nuxtUiRu } from '@nuxt/ui/locale'

Steps

  1. Run pnpm dlx nuxi analyze.
  2. Check client bundle, all locales are included.
  3. Remove rolldown-vite override in package.json and run pnpm i.
  4. Run pnpm dlx nuxi analyze again.
  5. Check client bundle, only imported locales are present.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions