Moment.js is well known for a very high size
There are many issues around this https://github.com/moment/moment/issues/2373
I saw that vue-good-table uses moment only to format dates in a couple of places
A good alternative for such operations is https://github.com/date-fns/date-fns
With date-fns you can import only the functions you need (e.g format) and not import the whole library to do this operation. This helps a lot reducing the overall vue-good-table size when used in production.
Update:
Here is some proof:
Simple app (vue-cli wepback with vue only)
As you can see the vendor file has 60kb which contains only Vue basically
Same app with a very basic vue-good-table added
Size went up from 60kb up to 688 kb because of moment.js
Thank you for bringing this up @cristijora. Makes a lot of sense. Looking into it.
v1.5.2 replaced moment with date-fns parse/format functions. Thank you @cristijora for the recommendation!
Most helpful comment
v1.5.2 replaced moment with date-fns parse/format functions. Thank you @cristijora for the recommendation!