I am wondering if it is possible to import only those parts of the library that you need, and not the entire package.
An example to illustrate what I mean.
import {gt} from 'ramda'; console.log(gt(3, 2)); // true
I save it and launch a browser on it:
browserify a.js -t babelify -o b.js
b.js now runs in the browser; but it is 8432 lines long! It imported the entire Ramda library, although I only need the content gt.js , _curry2.js , _curry1.js and isPlaceholder.js .
If instead I write an example above:
import gt from './node_modules/ramda/src/gt'; console.log(gt(3, 2)); // true
Then b.js turns out to be 98 lines long.
Is there any way (other than described by me) to get around this problem?
source share