These are chat archives for ramda/ramda

24th
Dec 2016
Marcus Nielsen
@marcusnielsen
Dec 24 2016 11:03

Hi, is there some good documentation for minimizing the build size of ramda with webpack (v2)?

8583eb5fbaa8685bfde4.ramda.js     305 kB  3, 4[emitted]  [big]ramda

The file starts and ends with ramda content, but it’s full of comments and probably all of the content although I’m just importing a couple of functions via import {merge as ramdaMerge} from ‘ramda’. Any handy tips of what you usually should do?

Marcus Nielsen
@marcusnielsen
Dec 24 2016 11:30
example: Ramda via cdn downloads 11.8 kb of content (ref: http://cdnjs.cloudflare.com/ajax/libs/ramda/0.22.1/ramda.min.js ).
While my current webpack build of ramada ends up with 299 kb when compared in the chrome network tab.
I’ve checked the file for ramda, and it starts and ends with ramda content, so nothing else than ramda is there except some small webpack jsonp stuff for loading it.
Marcus Nielsen
@marcusnielsen
Dec 24 2016 11:54
down to 41.8 kb by using node_modules/ramda/dist/ramda.min.js, but it’s still a lot higher than then cdn version. What’s the reason for the diff in size between the npm minified dist file and the cdn version?
and is dead code elimination possible with ramda?
Jared McGuire
@jrdmcgr
Dec 24 2016 15:18
@marcusnielsen I've read that webpack 2 supports tree shaking for es6 (https://webpack.github.io/docs/roadmap.html). I have not used it, but from what I understand, it should remove dead code.
Marcus Nielsen
@marcusnielsen
Dec 24 2016 17:07
@jrdmcgr I'm trying to sort things out why dead code and comments aren't removed in the webpack chat. More ppl have the same issue. But why is there a diff in file size between the node_modules/ramda/dist/ramda.min.js and the cdn minified version?