Hello, guys!
During my experiments with Tree Shaking in Ramda I found that the maximum profit I can get from it is the reducing a bundle on about 7Kb.
I'm wondering, is this because of the dependencies in Ramda or because of Webpack, or something else?
Here is how I tested it.
I created a file with the next code
import * as R from "ramda"
R.identity()
And compiled it two times:
with [email protected] the size of the bundle was 59.2 kB
and with [email protected] - 51.2 kB.
In my real project, where I did the same experiment, four bundles that use Ramda decreased their size on about 7Kb.
On the other hand, when I imported identity function directly from the source file, like this:
import identity from "ramda/src/identity"
identity()
size of the bundle was only 916 bytes. That kinda result I was expecting from Tree Shaking.
Code and Webpack configurations I uploaded to this repo:
https://github.com/scabbiaza/ramda-webpack-tree-shaking-examples
Hello, guys!
During my experiments with Tree Shaking in Ramda I found that the maximum profit I can get from it is the reducing a bundle on about 7Kb.
I'm wondering, is this because of the dependencies in Ramda or because of Webpack, or something else?
Here is how I tested it.
I created a file with the next code
And compiled it two times:
with
[email protected]the size of the bundle was 59.2 kBand with
[email protected]- 51.2 kB.In my real project, where I did the same experiment, four bundles that use Ramda decreased their size on about 7Kb.
On the other hand, when I imported
identityfunction directly from the source file, like this:size of the bundle was only 916 bytes. That kinda result I was expecting from Tree Shaking.
Code and Webpack configurations I uploaded to this repo:
https://github.com/scabbiaza/ramda-webpack-tree-shaking-examples