I’m pretty sure this is a duplicate, but I couldn’t find another already open issue about it.
I’d like to not transpile my es6 code with babel to es5 before uglifying it: I’d rather use a minified es6 version of my codebase.
Is there any uglifier production-ready/webpack-ready for this?
Watching in the meantime:
https://gist.github.com/avdg/43002267f959210a69aa3ec0f21ed751
I can see two options:
uglifyjs
dependency to the branch.I’m not actually sure why UglifyJS plugin is at the core level as it could easily be a package of its own. Extra dependency to manage then, though.
+1 for removing UglifyJS from the core level.
FYI, there’s a Babel specific minifier these days. See https://github.com/boopathi/babili-webpack-plugin .
@fulls1z3 I don’t quite understand what you are/were trying to do with that fork. There is no need to fork Webpack in order to use the harmony branch; just add
"uglify-js": "git://github.com/mishoo/UglifyJS2#harmony"
to your project’s package.json,rm -rf node_modules && npm install
, and voilà.@Kitanotori @fulls1z3 I set up a repository. There’s a basic demo that works. I didn’t port the tests over, though (it’s a Jest based setup).
@damianobarbati There’s not that much difference, but I think we all should strive for advancing the ecosystem. If we still keep transpiling to ES5 10 years from now on, I think the JavaScript ecosystem has failed miserably.
And, as we all know, browser manufacturers are a bit slow in optimizing their code, so we shouldn’t really be expecting huge performance benefits in near future (or should we?). But the thing is, if we just keep using the plain-old-es5, the browser manufacturers are not really incentivized to optimize their support for ES5+ features.
I am using webpack 2.5.1 and “uglify-js”: “git://github.com/mishoo/UglifyJS2#harmony”,
It worked till 8th may 2017.
Now it fails with the error:
Does anyone has similar error?
UglifyJS seems to have bumped to a new major version. Try
"uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22"
I have the same trouble with ES6, babel-minify-webpack-plugin is work well with ES6 in my project.
Installing
"uglifyjs-webpack-plugin": "^1.0.0-beta.2"
works for me (with"webpack": "^3.6.0"
).