2.1.1 • Published 2 years ago

babel-plugin-ramda v2.1.1

Weekly downloads
71,523
License
WTFPL
Repository
github
Last release
2 years ago

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"]
});
2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

5 years ago

1.6.3

6 years ago

1.6.2

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.0

9 years ago