Moment included twice to change language?
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.
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?
+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 });