3 ms·
Moment.js gets a lot smaller if you apply the same trick Day.js is using here, that is, to just load the locales that you need. See https://medium.com/rise-eng
by tyingq 4y ago
Moment.js gets a lot smaller if you apply the same trick Day.js is using here, that is, to just load the locales that you need.
See https://medium.com/rise-engineering/how-we-managed-to-shed-300kb-of-moment-js-size-in-angular-d2931d448194 https://medium.com/rise-engineering/how-we-managed-to-shed-3... for an example. Takes Moment.js from 364KB to 59KB. Still much larger than 2KB, but perhaps small enough.
- ramesh31 4y agoMoment has always been absurdly large. There's really no reason for it. The vast majority of usages can be solved with 4 lines of native `Date` object based code.