-
Notifications
You must be signed in to change notification settings - Fork 76
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
i18next theme load all locales #93
Comments
I think there is a similar issue in |
I'm not sure I understand your question, can you please clarify what you expect to happen and what currently happens? |
Hello, in my case I was testing with the When a page was built, for example for the en locale, the built assets contain translations in all languages that I had. I could see messages in different languages in the What I expect is that a page built for a locale only contains translated messages for that specific locale. |
Hi @LekoArts, see below the screenshot for what's happening when using The whole I would expect the translations to be in their own chunks or better yet not having to download them at all. I'm certainly missing some insights but with a static site generator, we don't need the |
This is especially bad with large sites, as bundle size can be huge and a change to any string anywhere means all pages need to rebuild. It seems that the problem is that webpack will statically anylyse The technique may work with @LekoArts perhaps a warning should be added to the i18n themes that this technique isn't suitible for large sites? |
Hi,
I suppose the following code, the webpack will load all files in
GATSBY_THEME_I18N_REACT_I18NEXT
, is there a better way to only load the current locale?themes/packages/gatsby-theme-i18n-react-i18next/src/wrap-page-element.js
Line 14 in fead1c2
The text was updated successfully, but these errors were encountered: