Vue-js-modal: Vuejs loaded twice

Created on 15 May 2017  路  5Comments  路  Source: euvl/vue-js-modal

dist/index.js contains vuejs 2.2.6.

If I use import vmodal from 'vue-js-modal'; in an existing vuejs project, vuejs is loaded twice because my main application uses version 2.3.3.

What is the general approach to overcome this? I am a ES6 noob, so sorry if this is dumb question :)

bug help wanted looks good to me

Most helpful comment

Yeah, I don't think it's common to have it included in dist. From what I read you need to use path.resolve. See e.g. https://github.com/webpack/webpack/issues/2134#issuecomment-192579511 and http://stackoverflow.com/questions/31169760/how-to-avoid-react-loading-twice-with-webpack-when-developing.

All 5 comments

It is pretty good question, thanks for noticing it.
I think i should remove it from dependencies.

But i will need a help of webpack gugu to figure out how to correctly package it without included vuejs lib.The reason being is that without vuejs being "built in" es5 build fails.

Yeah, I don't think it's common to have it included in dist. From what I read you need to use path.resolve. See e.g. https://github.com/webpack/webpack/issues/2134#issuecomment-192579511 and http://stackoverflow.com/questions/31169760/how-to-avoid-react-loading-twice-with-webpack-when-developing.

Hey @a3020, I think I've done it 馃槃
If you will check the latest master, it has a 卤30 kb dist/index.js (instead of a bloody 卤300kb) and it seems to work as it used in the demos.

Would you have time to test whether it works for your project?
(keep in mind its not on npm yet, only on github)

I used npm install --save-dev git+ssh://[email protected]/euvl/vue-js-modal to install directly from the Github repo. I then ran webpack. All still works and vue-js is only loaded once. So yes, I think you nailed it 馃憤

Great, thanks a lot for your help! 馃憤 馃
Will do a new release now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ishetnogferre picture ishetnogferre  路  4Comments

at0g picture at0g  路  3Comments

ptilli picture ptilli  路  3Comments

Max64 picture Max64  路  4Comments

yyh1102 picture yyh1102  路  3Comments