vue-moment icon indicating copy to clipboard operation
vue-moment copied to clipboard

Moment included twice to change language?

Open fjeddy opened this issue 6 years ago • 2 comments

Hello,

From all the reference I can find, then they all refer to importing moment, change the language and then pass moment to the vue-moment instance.

Problem is, you include moment twice in your build. vue-moment is 56kb compressed while moment is another 56kb compressed (Excluding the locales).

Isn't this counter-intuitive? vue-moment include it's own version of moment, and then you need to include another instance just to change the language. Importing the language alone isn't good enough.

Vue is very eager to warn about any files exceeding the 244kb limit, and with this library, and the need to change language, consumes 110kb on it's own. It's excessive.

fjeddy avatar Jun 19 '19 11:06 fjeddy

I was confused by the size vue-moment.js(56k) in my bundle. Then I realized that moment.js is about the same size. It clearly seems to be included included twice. Has this issue been addressed?

Screen Shot 2020-05-11 at 2 52 37 PM

gzurbach avatar May 11 '20 21:05 gzurbach

+1 Same Issue Moment is included twice

To Only load an additional language/locale i do this:

const moment = require('moment'); require('moment/locale/de'); moment.locale('de');

Vue.use(require('vue-moment'), { moment });

sgtpepperaut avatar Jun 14 '20 15:06 sgtpepperaut