Moment.js is a great and comprehensive library to use date, times, and formatting.
Why should not we use it ? 232 kB (or 66 kB gzipped). 68kB without the translations.
So what would you do if you need to demo or bundle a component depending on moment.js, but without the library ?
You can either use Date but it is kind of difficult. Or use a lighter library. Or fake out moment.js like I do.
I wrote a dedicated fake version of moment.js to reproduce the behavior of the library without having to to pull it.
The attempt can be read and reused from this URL : https://gist.github.com/libetl/05e9c212c920d5c33441f7e183bc0dc4
This version only weights 4.6kB. It only has a few of the existing operations but they do work.
And of course, you can make your bundler use this module when importing ‘moment’ by using import aliases.
Don’t hesitate to copy or fork for your own needs.