This plugin is a transform to remove unused rambdax dependencies, without forcing the user to cherry pick methods manually. This lets you use rambdax naturally (aka as documented) without worrying about bundling parts you're not using.
See also babel-plugin-lodash
.
Converts
// @notice: donot support importNamed, will throw a exception:
// import { map, add } from 'rambdax'
import RX from 'rambdax';
RX.map(RX.add(1), [1, 2, 3]);
Roughly to
import add from 'rambdax/src/add';
import map from 'rambdax/src/map';
map(add(1), [1, 2, 3]);
- You must be using ES6 imports (both specifiers and default work) to load rambdax.
I receive
TypeError: The plugin "rambdax" 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.
{
"plugins": ["rambdax"]
}
or
{
"plugins": "rambdax"
}
$ babel --plugins rambdax script.js
require("babel-core").transform("code", {
plugins: ["rambdax"]
});