Skip to content
Easy 🐏 modular builds
Branch: master
Clone or download
Latest commit e4c872d May 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Restore nullified R identifier (fixes #33) Aug 22, 2018
test fix tests May 20, 2019
.babelrc upgrade to babel 7 Oct 8, 2018
.gitignore Update ignore files and building Aug 6, 2015
.npmignore Update ignore files and building Aug 6, 2015
.travis.yml update travis node version May 20, 2019
CHANGELOG.md Create CHANGELOG.md Jan 15, 2019
README.md add documentation for useES option Jan 27, 2018
package-lock.json package-lock.json update May 20, 2019
package.json 2.0.0 Dec 13, 2018

README.md

babel-plugin-ramda Build Status

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 babel-plugin-lodash.

Example

Converts

import 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 receive TypeError: 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"]
}

or

{
  "plugins": [
    ["ramda", {
      "useES": true
    }]
  ]
}

to use the new ramda/es/ path for imports, which is available since Ramda 0.25. This is recommended as it uses ES modules rather than CommonJS. It defaults to ramda/src/ when omitted.

Via CLI
$ babel --plugins ramda script.js
Via Node API
require("babel-core").transform("code", {
  plugins: ["ramda"]
});
You can’t perform that action at this time.