This plugin is a transform to remove unused ramda dependencies, without forcing the user to cherry pick methods manually. This lets you use ramda naturally (aka as documented) without worrying about bundling parts you're not using.
See also
Roughly to
Babel v5 is no longer supported. Use v0.1.2 for support.Via
See also
babel-plugin-lodash
.Example
Convertsimport R, {map} from 'ramda';
map(R.add(1), [1, 2, 3]);
Roughly to
import add from 'ramda/src/add';
import map from 'ramda/src/map';
map(add(1), [1, 2, 3]);
Limitations
- You must be using ES6 imports (both specifiers and default work) to load ramda.
FAQ
I receiveTypeError: The plugin "ramda" didn’t export a Plugin instance
or, can I use this plugin with Babel v5?
Babel v5 is no longer supported. Use v0.1.2 for support.
Usage
Via .babelrc
(Recommended)
{
"plugins": ["ramda"]
}
Via CLI
$ babel --plugins ramda script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["ramda"]
});