This repo is used for ramda tree shaking tests.
Comment / uncomment import methods in index.js
:
// No tree shaking (200+ modules, heavy weight)
// import * as R from 'ramda'
// import { identity } from 'ramda'
// Working tree shaking (4 modules, lightweight)
// import identity from 'ramda/src/identity'
// Weird tree shaking (4 modules, but heavy weight)
// import identity from 'ramda/es/identity'
Then, execute the following command to compare results:
ANALYZE=true npm run build
See the related issue for more informations.
In order to enable babel-plugin-ramda, please create a .babelrc
file:
// .babelrc
{
"presets": [
["next/babel", {
"ramda": {
"useES": true
}
}]
]
}
And use the import identity from 'ramda/es/identity'
import method.