https://github.com/polytypic/ramda-rollup-hack
Hack to modify Ramda in-place to support Rollup and UglifyJS2 for effective dead code elimination
https://github.com/polytypic/ramda-rollup-hack
dead-code-elimination kludge ramda rollup uglifyjs2
Last synced: 3 months ago
JSON representation
Hack to modify Ramda in-place to support Rollup and UglifyJS2 for effective dead code elimination
- Host: GitHub
- URL: https://github.com/polytypic/ramda-rollup-hack
- Owner: polytypic
- Created: 2017-05-03T09:51:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-11T10:41:24.000Z (over 7 years ago)
- Last Synced: 2025-02-18T18:47:05.507Z (3 months ago)
- Topics: dead-code-elimination, kludge, ramda, rollup, uglifyjs2
- Language: JavaScript
- Size: 2.93 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**_๐๐๐ This project is obsolete as of [Ramda `^0.25.0`](https://github.com/ramda/ramda/issues/2319). ๐๐๐_**
# Ramda Rollup Hack ยท [](http://badge.fury.io/js/ramda-rollup-hack)
This is a quick and dirty hack that converts [Ramda](http://ramdajs.com/)
in-place to support [Rollup](https://rollupjs.org/)
and [UglifyJS2](http://lisperator.net/uglifyjs/) `/*#__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:```js
{
// ...
"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.