-
Notifications
You must be signed in to change notification settings - Fork 10
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
use uppy locales #63
base: master
Are you sure you want to change the base?
use uppy locales #63
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth splitting the locales into their own webpack chunks so we only download the ones we need?
try { | ||
let lang = (_lang ? _lang : kiwi.i18n.language).split('-') | ||
lang = lang[0] + '_' + lang[1].toUpperCase() | ||
return require(/* webpackMode: "eager" */ '@uppy/locales/lib/' + lang) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be done with static import paths? Import paths that are determined at runtime can cause problems like webpack including unnecessary files in the bundle because it can't tell what's going to be needed, etc.
lang = lang[0] + '_' + lang[1].toUpperCase() | ||
return require(/* webpackMode: "eager" */ '@uppy/locales/lib/' + lang) | ||
} catch (e) { | ||
return require(/* webpackMode: "eager" */ '@uppy/locales/lib/en_US') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably also use the import()
syntax, since we're already using import
statements instead of require
everywhere else.
I could not get webpack to behave and load the chunks from the right place, always wanted to load the from webroot |
this does increase the package size by ~80KB
closes #51