-
Notifications
You must be signed in to change notification settings - Fork 22
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
All locale files bundled? #6
Comments
Agree with this practice. |
I think remove the code below can solve it: timeago.register(this.props.locale, require('timeago.js/locales/' + this.props.locale)); and developers register locales out of the component, this will modify the usage, so new big version will be release. So can help to give us a pr ? |
@theseushu The commit 4ac9b5d can solve this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I haven't tested yet, but seems
require('timeago.js/locales/' + this.props.locale));
will cause webpack to bundle all files under timeago.js/locales. (webpack has noway to know what value 'this.props.locale' could be, so it just includes all files in that folder)
Cannot find original docs, see this comment
webpack/webpack#38 (comment)
So code like this
is pretty much the same as require every thing statically.
The easiest solution shall be drop these lines, let user load locale files they need and pass to this component.
The text was updated successfully, but these errors were encountered: