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

switch to uglify-es #33

Closed
graingert opened this issue May 10, 2017 · 14 comments
Closed

switch to uglify-es #33

graingert opened this issue May 10, 2017 · 14 comments

Comments

@graingert
Copy link

Related somewhat to #32

get rid of all the "if using ES2017 install from git" etc, and switch to uglify-es only.

@skorunka
Copy link

skorunka commented May 21, 2017

How can I use uglify-es instead of uglify-js in webpack?
I have this in devDependencies "uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony", and in webpack.config:
new webpack.optimize.UglifyJsPlugin()

And still get the Unexpected token: punc ()) errors.

Thank you.

@bebraw
Copy link
Contributor

bebraw commented May 21, 2017

@skorunka It's not possible until someone ports the plugin to the new API of Uglify.

@skorunka
Copy link

@bebraw I see, is there any workaround?

@bebraw
Copy link
Contributor

bebraw commented May 21, 2017

@skorunka No workaround until someone has time to perform the upgrade.

@skorunka
Copy link

@bebraw Thank you.

@johnspurlock
Copy link

@skorunka Hmm, I've been using a similar workaround (see below) while waiting for this issue, and it seems to be working for me. Copying here in case it helps you.

/* package.json */
"devDependencies": {
    "uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22",
    "uglifyjs-webpack-plugin": "0.4.3",
/* webpack.config.js */
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
new UglifyJSPlugin()

@skorunka
Copy link

That helped! I had to delete node_modules folder and npm i so I get the rid of all previously installed uglify-js mutations.

@JemarJones
Copy link
Contributor

Why does the README tell us to use github.com/mishoo/UglifyJS2#harmony and not mention @johnspurlock's fix?

@bebraw
Copy link
Contributor

bebraw commented Jun 8, 2017

@JemarJones PR welcome. Thanks. 👍

@zhaiduo
Copy link

zhaiduo commented Jun 22, 2017

Try method from @johnspurlock, still not work.

ERROR in scripts/p.js from UglifyJs
Unexpected token: punc ()) [scripts/p.js:80,64]

This is my devDependencies:

"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-preset-es2015": "^6.24.1",
"uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22",
"uglifyjs-webpack-plugin": "^0.4.3",
"webpack": "^2.6.1",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-dev-middleware": "^1.10.2",
"webpack-hot-middleware": "^2.18.0",

@kurtextrem
Copy link

The most recent uglifyjs-webpack-plugin version broke something. If I return back to 0.4.4 everything works again.

@ricricucit
Copy link

I still get Unexpected token punc «(» anyone?

@graingert
Copy link
Author

@ricricucit could you make a test case for that?

This was referenced Jun 29, 2017
@michael-ciniawsky
Copy link
Member

Done in #63

torch2424 added a commit to torch2424/ampstart that referenced this issue Jul 13, 2017
Used the Yeoman fountain webapp generator, made a react project,
ripped out all react stuff, and made the followiing webpack fix:
webpack-contrib/uglifyjs-webpack-plugin#33

requires "uglifyjs-webpack-plugin": "0.4.3",
torch2424 added a commit to torch2424/ampstart that referenced this issue Jul 19, 2017
Used the Yeoman fountain webapp generator, made a react project,
ripped out all react stuff, and made the followiing webpack fix:
webpack-contrib/uglifyjs-webpack-plugin#33

requires "uglifyjs-webpack-plugin": "0.4.3",
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

9 participants