sindresorhus/mimic-function

Older uglify doesn't support ES6

zedd45 opened this issue · 1 comments

I'm working on a "legacy" stack that uses Webpack v1.x.x (currently 1.13.3), and the version of uglify I'm using doesn't support e6.

I noticed that the index.js file uses an arrow function to assign the module.exports.

Would you accept a PR to ES5ify this, so my webpack doesn't explode with this error:

ERROR in bundle.{hash}.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./~/mimic-fn/index.js:2,0]

I would be happy to submit one.

We aim for Node.js, not the browser. You can find a more detailed explanation here sindresorhus/ama#446.

If you use Webpack, check out babel-engine-plugin, which transpiles only the dependencies that needs to be transpiled.