Bundle size distribution

40 views
Skip to first unread message

Olivier Ligot

unread,
Dec 16, 2015, 6:26:43 AM12/16/15
to jspm
Hi,

For a given bundle, is there a way to know the size distribution across the modules (like you would find in a disk usage analyzer) ?
This would allow to have an idea on which modules are the biggest one.

Exemple:
> jspm bundle-distribution bundle.js
Module   Size        Percentage
react        150 KB   88,2 % 
lodash       17 KB      10 %
redux          2 KB      1,2 %
app/app      1 KB      0,6 %  

Regards,

Olivier

Guy Bedford

unread,
Dec 16, 2015, 3:47:14 PM12/16/15
to Olivier Ligot, jspm
We don't currently offer any sizing graphs, although this would be easy to put together through the Builder API.

If anyone feels like working on something along these lines, it would definitely be a great feature to see.

--
You received this message because you are subscribed to the Google Groups "jspm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jspm-io+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Cox

unread,
Dec 16, 2015, 3:52:44 PM12/16/15
to Olivier Ligot, jspm


On Dec 16, 2015 06:26, "Olivier Ligot" <oli...@gmail.com> wrote:
>
>
> For a given bundle, is there a way to know the size distribution across the modules (like you would find in a disk usage analyzer) ?
> This would allow to have an idea on which modules are the biggest one.
>

Couldn't you just load the site without the bundle then watch your browsers network monitor?

Of course I don't think there is any way to account for cross-dependency compression. If you want that you would probably just have to make multiple bundles and compare them manually.

Olivier Ligot

unread,
Dec 16, 2015, 4:09:50 PM12/16/15
to jspm, oli...@gmail.com
I'll try to find some time to work on it.
Concerning the Builder API, do you mean this project: https://github.com/systemjs/builder ?

Guy Bedford

unread,
Dec 16, 2015, 4:11:40 PM12/16/15
to Olivier Ligot, jspm
Yes exactly, that API is provided through http://jspm.io/docs/api.html#class-builder in jspm.

Olivier Ligot

unread,
Apr 8, 2016, 9:06:46 AM4/8/16
to jspm, oli...@gmail.com
I just found this tool called ndu that allows to visualize your Node app's disk space usage:
https://github.com/groupon/ndu

This could serve as an inspiration to what we'd like to do here.
Under the hood, it uses D3 to draw the graphs in the browser which is quite nice:
http://groupon.github.io/ndu/


Le mercredi 16 décembre 2015 21:47:14 UTC+1, Guy Bedford a écrit :

Olivier Ligot

unread,
Oct 6, 2016, 8:33:31 AM10/6/16
to jspm
Hi,

Just to let you know that I've found an awesome project that does just that and is not specifically linked to jspm: source-map-explorer.
I ran it on one of our projects and I could save 23% of file space just by switching to another dependency !
Reply all
Reply to author
Forward
0 new messages