Hack to modify Ramda in-place to support Rollup and UglifyJS2 for effective dead code elimination
  • JavaScript 100%
Find a file
2017-10-11 13:40:41 +03:00
.gitignore Initial 2017-05-03 12:57:19 +03:00
package.json Initial 2017-05-03 12:57:19 +03:00
ramda-rollup-hack Initial 2017-05-03 12:57:19 +03:00
README.md Update README.md 2017-10-11 13:40:41 +03:00

πŸŽ‰πŸŽ‰πŸŽ‰ This project is obsolete as of Ramda ^0.25.0. πŸŽ‰πŸŽ‰πŸŽ‰

Ramda Rollup Hack Β· npm version

This is a quick and dirty hack that converts Ramda in-place to support Rollup and UglifyJS2 /*#__PURE__*/ annotations. This allows one to use Ramda with Rollup without having to specify named exports by hand and also makes dead code elimination by UglifyJS2 effective on Ramda.

Usage

Run ramda-rollup-hack after installing Ramda. For example, you could do it in the prepare script of NPM:

{
  // ...
  "scripts": {
    // ...
    "prepare": "ramda-rollup-hack"
  }
}

The ramda-rollup-hack script modifies the package.json file of the Ramda under node_modules to include a "module" entry pointing to ES module copies *.js -> *-es.js of Ramda sources created by the script.

The ramda-rollup-hack script has been designed to be idempotent so that running it multiple times against exactly matching Ramda version should not change anything.