3 ms·
Most of moment's size is in the localizations. You can reduce it from 300kb to 100kb by removing them or only including the ones you care about: https://stackov
by caseymarquis 8y ago
Most of moment's size is in the localizations. You can reduce it from 300kb to 100kb by removing them or only including the ones you care about: https://stackoverflow.com/questions/25384360/how-to-prevent-moment-js-from-loading-locales-with-webpack https://stackoverflow.com/questions/25384360/how-to-prevent-...
I think the bigger lesson, if moment's size is news to you (for those of us using webpack), is to install webpack-bundle-analyzer. It's loads of fun, if you like visualizations.
- dcposch 8y agoYou can further reduce that to 0kb by using window.Intl . You get locale and timezone aware date formatting, built-in on all modern browsers. The API is pretty nice! https://caniuse.com/#feat=internationalization https://caniuse.com/#feat=internationalization