Closed
Description
I've made investigation today using vue cli, and that's what I got:
vue : 61.77 kb
vue + vue-socket.io-extended : 132.10 kb
vue + vue-socket.io-extended + custom socket.io-client : 190.87 kb
There is a duplication of socket.io-client
library when you pass socket.io-client
instance to the plugin.
So if you use it this way, you probably have extra ~70kb
of useless data in your build.
The only way to fix it is to force library user to pass socket.io-client
instance always.
Advantages:
- less build size with custom
socket.io-client
(e.g.~70Kb
) - no force version of
socket.io-client
for user - no need to support
socket.io-client
inside the library (update library just becausesocket.io-client
updated) - user can pass any library compatible with
socket.io-client
, for example,socket.io-client/dist/socket.io.slim.js
which is ~8kb smaller thansocket.io-client
but drops IE6-8
Disadvantages:
- little harder to setup