sahat / hackathon-starter

A boilerplate for Node.js web applications
MIT License
34.88k stars 8.18k forks source link

Replaced moment.js with date-fns to reduce bundle size #1098

Closed dimshik100 closed 2 years ago

dimshik100 commented 4 years ago

moment.js is great but it is huge and not tree shakable. I replaced it with only the required functions from the smaller date-fns and by that reduced date utility library size from 18.2K gzipped (moment.min.js) to 7K gzipped (used add, format and isBefore functions)

simon1tan commented 2 years ago

Wouldn't dayjs be better? Should be pretty compatible with moment https://www.npmjs.com/package/dayjs Unpacked Size 623 kB