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
onlyLocales
not working for SFC <i18n locale="xx">
#329
Labels
Status: Review Needed
Request for review comments
Comments
imslepov
added a commit
to imslepov/bundle-tools
that referenced
this issue
May 15, 2024
kazupon
pushed a commit
that referenced
this issue
May 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reporting a bug?
Forwared from nuxt-modules/i18n#2588
onlyLocales
feature is very usefull, but not working for Single File Component locales in different blocks. If I use<i18n>
blocks in component, every locales will be included in result bundle.Expected behavior
Expected result is only locales described in
onlyLocales
will be included.Reproduction
https://github.com/alexbidenko/i18n-problem
Just
pnpm i
,pnpm build
andpnpm preview
. In network tab of dev tools you can see, that both of lacales exists in bundle.P.S. in example I use
Lazy
for component, but and without it problem is same.Lazy
is added for better visibility in the network tabIssue Package
unplugin-vue-i18n
System Info
Screenshot
Additional context
Motivation.
If project is large (hundreds of pages with tens of locales) that performance will be bad. For optimization is usefull build different versions of site for every locales. Every build will contains only one locale. And every page (or components) of every build will contains self locale strings. Then every locales will be downloaded to browser optimized.
Validations
The text was updated successfully, but these errors were encountered: