Skip to content

Profit from Tree Shaking in Ramda in Webpack #2355

Description

@scabbiaza

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 ramda@0.24 the size of the bundle was 59.2 kB
and with ramda@0.25 - 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions