jimmywarting / FormData

HTML5 `FormData` polyfill for Browsers and nodejs
MIT License
360 stars 102 forks source link

minification issue with uglify #8

Closed jony89 closed 7 years ago

jony89 commented 7 years ago

when compiling with uglify I get :

ERROR in 1.chunk.js from UglifyJs SyntaxError: Unexpected token: operator (>) [1.chunk.js:7515,15]

because of the line :

    const wm = o => map.get(o)

This is because the file is not transpiled, so i had to add this module so babel will transpile it during build, i think you should satisfy es5 script as the main script (compiled) and use js:next for the es6 code.

Also test minification of mode as stand alone.

garrensweet commented 7 years ago

@jony89 What module did you use to get this to work?

jony89 commented 7 years ago

u didn't get me, usually you are not supposed to transpile modules in node_modules folder, or at least not specifying this, but with this one I had to, so I specifically specify this module( in webpack confguration for example) so babel will transpile it as well, because it's main script is ES6.

reesscot commented 7 years ago

Any update on getting this to work with uglify in webpack @jimmywarting? I am having the same issue described by @jony89. Would love to be able to use this as an npm module.

jimmywarting commented 7 years ago

I put a minified version up on npm from closure compiler that is now used by default