Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moment included twice to change language? #118

Open
fjeddy opened this issue Jun 19, 2019 · 2 comments
Open

Moment included twice to change language? #118

fjeddy opened this issue Jun 19, 2019 · 2 comments

Comments

@fjeddy
Copy link

fjeddy commented Jun 19, 2019

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.

@gzurbach
Copy link

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

@sgtpepperaut
Copy link

+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
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants