-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Large bundle size addition for lazy loading when many translations files #1222
Comments
This is the lazy resource lookup maps created when using a template string within
It is not specific to this library but to how Webpack fundamentally works. Take a look at the underlying https://webpack.js.org/api/module-variables/#importmetawebpackcontext Webpack needs a map of all available lazy modules that match the pattern |
Thanks @m-sanders It basically means the more pages i have, the more bundle size i will serve. |
@iliran11 I see |
What version of this package are you using?
2.6.2
What operating system, Node.js, and npm version?
Node.js. Using the pages system of next.js (not app router)
What happened?
I am migrating to next-translate. we have over 200 namespaces files (12 languages, 19 namespaces)
When I am inspecting the bundle size, i see a rather large addition to my bundle size, due to the lazy loading.
I am using
loadLocaleFrom
function in the following way:What did you expect to happen?
No impact on bundle size. if we would want to expand to 30 languages, then it would affect the whole website.
The text was updated successfully, but these errors were encountered: