Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

can not support es6 minification after upgrade to 0.4.6 #49

Closed
lili21 opened this issue Jun 22, 2017 · 15 comments
Closed

can not support es6 minification after upgrade to 0.4.6 #49

lili21 opened this issue Jun 22, 2017 · 15 comments

Comments

@lili21
Copy link

lili21 commented Jun 22, 2017

the 0.4.6 version move the uglify2 to dependencies, so I can't specify the uglify2 version through yarn add git://github.com/mishoo/UglifyJS2#harmony-v2.8.22 --dev. cause the plugin will use its own dependency - uglify-js^2.8.29.

@pkeuter
Copy link

pkeuter commented Jun 22, 2017

Duplicate of #32. See #32 (comment) for a workaround.

@paulpflug
Copy link

this is no duplicate.. the workaround doesn't work anymore

@Hotell
Copy link

Hotell commented Jun 27, 2017

Yup this is very unfortunate. Patch version breaking stuff... :( https://travis-ci.org/Hotell/typescript-lib-starter/builds/244709499?utm_source=github_status&utm_medium=notification

@pkeuter
Copy link

pkeuter commented Jun 29, 2017

It is a duplicate. The workaround doesn't work exactly as noted there anymore, but if you change uglify-js "^2.8.29" to uglify-js "^2.8.22". Everything is fine. Still an ugly workaround though.

@lili21
Copy link
Author

lili21 commented Jun 29, 2017

I don't get it.

@pkeuter
Copy link

pkeuter commented Jun 29, 2017

uglify-js@^2.6, uglify-js@^2.8.22, "uglify-js@git://github.com/mishoo/UglifyJS2#harmony-v2.8.22":
  version "2.8.22"
  resolved "git://github.com/mishoo/UglifyJS2#278577f3cb75e72320564805ee91be63e5f9c806"
  dependencies:
    source-map "~0.5.1"
    yargs "~3.10.0"
  optionalDependencies:
    uglify-to-browserify "~1.0.0"

...

uglifyjs-webpack-plugin@^0.4.4, uglifyjs-webpack-plugin@^0.4.6:
  version "0.4.6"
  resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309"
  dependencies:
    source-map "^0.5.6"
    uglify-js "^2.8.22"
    webpack-sources "^1.0.1"

@lili21
Copy link
Author

lili21 commented Jun 29, 2017

That is the yarn.lock file. I won't say that is a workaround.

@pkeuter
Copy link

pkeuter commented Jun 29, 2017

It is a workaround, because it works. This is the exact same workaround as posted in #32, with uglify-js "^2.8.22" modified from uglify-js "^2.8.29". Like I said. It's not pretty, but it works.

@lili21
Copy link
Author

lili21 commented Jun 29, 2017

There was a better workaround, just run the yarn add git://github.com/mishoo/UglifyJS2#harmony-v2.8.22 --dev command. which be mentioned in readme. But the 0.4.6 version broken this. that's why I create this issue.

@kurtextrem
Copy link

@pkeuter This is not about the regular versions, but about the harmony branch. If uglifyjs-webpack-plugin states regular 2.8.29 as dependency, npm doesn't care if you have the harmony branch as dependency set.

@pkeuter
Copy link

pkeuter commented Jun 30, 2017

@kurtextrem I know this is about the harmony branch, but changing the yarn.lock file as mentioned before, will let this plugin use the older version of the harmony branch of UglifyJS. Again: it's not a brilliant "solution", but it fixes the build for me.

@michael-ciniawsky
Copy link
Member

Will be fixed by #63 soon, currently ES2015 minification isn't supported directly 😞

@kurtextrem
Copy link

The other question is, why is a patch version breaking things? Just by removing this line: https://github.com/webpack-contrib/uglifyjs-webpack-plugin/blob/master/package.json#L54 this whole issue would be fixed again.

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Jul 4, 2017

@kurtextrem peerDependency broke webpack, bc of the missing uglify package, so just reverting wouldn't fix it

@mikesherov
Copy link

@kurtextrem also note that for <1.0.0, semver guarantees don't exist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants