-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: import locales and moment instead of moment-with-locales #803
Conversation
True, doesn't work in Forms.. |
2c86fbb
to
e5d9674
Compare
e5d9674
to
79c12e9
Compare
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.
No sure this looks much more complicated than the webpack changes?
It is more complicated than to fix on the I haven't found an easier solution, tried different moment dists, tried to play with disabling optimization. import.meta.glob doesn't work with packages. The PR with a fix in the webpack config is ready for review as well, I'm fine with any way. |
Sorry, not my level of code understanding :( |
moment-with-locales doesn't work in Webpack due to invalid unused require Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
79c12e9
to
8e5f77a
Compare
Closing in flavor of nextcloud-libraries/webpack-vue-config#533 No issues now with |
moment/min/moment-with-locales.js
works only in Node.js and is not compatible with Webpack bundling. It has an unused functionlocalLocale
that requires locales by invalid relative path./locale
. Though it is not used, Webpack tries to resolve it withrequire.context
and fails.Example of issue in Talk, same in Text and other apps:
The current solution via Vite plugin manually import all the locales from ES modules from
dist
and importsmoment
from the samedist
with ESMs. Each module defines locale in thismoment
.Alternative to:
./locale
import frommoment/min/moment-with-locales
webpack-vue-config#533See also:
moment/min/moment-with-locales.js
: https://github.com/moment/moment/blob/develop/min/moment-with-locales.js#L2159