Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upPlugin breaks to minify es2015 and newer #112
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evilebottnawi
Aug 21, 2017
Member
@code-chris link above help to solve problem, if not please provide a minimum reproducible test repo, thanks!
|
@code-chris link above help to solve problem, if not please provide a minimum reproducible test repo, thanks! |
evilebottnawi
added
the
flag: Needs more info
label
Aug 21, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
code-chris
Aug 21, 2017
Thanks for your quick reply, but the issue still occurs: https://github.com/code-chris/uglifyjs-repro
code-chris
commented
Aug 21, 2017
|
Thanks for your quick reply, but the issue still occurs: https://github.com/code-chris/uglifyjs-repro |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kzc
Aug 21, 2017
uglifyjs-webpack-plugin@0.4.6 and uglify-js@2.x can only minify ES5:
"uglifyjs-webpack-plugin": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz",
"integrity": "sha1-uVH0q7a9YX5m9j64kUmOORdj4wk=",
"dev": true,
"requires": {
"source-map": "0.5.7",
"uglify-js": "2.8.29",
"webpack-sources": "1.0.1"
}
},
If you've configured it successfully you would see uglify-es in package-lock.json.
kzc
commented
Aug 21, 2017
|
If you've configured it successfully you would see |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
code-chris
commented
Aug 21, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kzc
Aug 21, 2017
The stackoverflow instructions do work. All I can suggest is to delete node_modules and do a fresh npm install and verify the module versions in package-lock.json.
People experiencing issues configuring webpack should wait for the uglifyjs-webpack-plugin @1.0.0 release.
kzc
commented
Aug 21, 2017
|
The stackoverflow instructions do work. All I can suggest is to delete People experiencing issues configuring webpack should wait for the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
code-chris
Aug 21, 2017
clean install brings the initial error again, but ok. Is there a final release date planned (or a rough range) ?
code-chris
commented
Aug 21, 2017
|
clean install brings the initial error again, but ok. Is there a final release date planned (or a rough range) ? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evilebottnawi
Aug 22, 2017
Member
@code-chris First we should review and accept (or not accept) #108, some time later we will do final release, thanks!
|
@code-chris First we should review and accept (or not accept) #108, some time later we will do final release, thanks! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michael-ciniawsky
Aug 28, 2017
Member
npm i -D uglifyjs-webpack-plugin@beta (uglify-es) => Minify ES2015+
|
|
michael-ciniawsky
closed this
Aug 28, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kzc
Sep 13, 2017
@code-chris The reason for your test repo's failure are these two lines:
"prod": "webpack -p",
"dev": "webpack -d"You need to change them to:
"prod": "webpack --define process.env.NODE_ENV=production",
"dev": "webpack --define process.env.NODE_ENV=development"
webpack@3.5.5's -p and -d flags make use of uglifyjs-webpack-plugin@0.4.6 which uses the ES5-only uglify-js@2.8.29. This is not obvious at all and should probably be mentioned in the README.
ref: #104 (comment)
kzc
commented
Sep 13, 2017
|
@code-chris The reason for your test repo's failure are these two lines: "prod": "webpack -p",
"dev": "webpack -d"You need to change them to:
ref: #104 (comment) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
code-chris
Sep 13, 2017
@kzc yes, this actually fixed the bug in my test repo... thanks!
Unfortunately in my big project (with a much more complex webpack config) the plugin does not minify anything, without an error. Hopefully I can find the issue there...
code-chris
commented
Sep 13, 2017
|
@kzc yes, this actually fixed the bug in my test repo... thanks! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kzc
Sep 13, 2017
The problem is that webpack includes an earlier incompatible version of this plugin by name causing all the versioning confusion. Changing the plugin options only add to the confusion. The uglify-es version of this plugin really ought to have a different name since most users run into these same problems. I just noticed that stackoverflow is a fountain of incorrect advice on this subject - the wisdom of crowds. Better to wait for a new webpack release that makes use of the new uglify-es version of this plugin.
kzc
commented
Sep 13, 2017
|
The problem is that webpack includes an earlier incompatible version of this plugin by name causing all the versioning confusion. Changing the plugin options only add to the confusion. The |
code-chris commentedAug 20, 2017
Hi,
today I changed my TypeScript "target" setting from "es5" to "es2015". This caused an compile error in one of my typescript files:
The line and column refers to the class name. This error happens too with more modern target settings.
My setup:
Maybe this relates to #49, but I'm not sure.
Does anybody know why this happens? If you need more information, please tell me.
Thanks!