Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with uglify-es? #287

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

Does not work with uglify-es? #287

davistan opened this issue May 10, 2017 · 14 comments
Milestone

Comments

@davistan
Copy link

Hi, I've just tried to process a ES6 file using uglify-es.

The same file running on uglifyjs CLI works but using the minifier will produce error.

Using pump, produces error below:
Caused by: TypeError: Cannot read property 'replace' of undefined

Hope this can be fixed easily.

Thanks in advance.

@davistan
Copy link
Author

Just saw this - perhaps this is caused by this: mishoo/UglifyJS#1907

@terinjokes
Copy link
Owner

@davistan Probably. You'll be able to use it after we release a beta supporting v3 of UglifyJS.

@terinjokes terinjokes added this to the v3.0.0 milestone May 10, 2017
@davistan
Copy link
Author

davistan commented May 11, 2017 via email

@terinjokes
Copy link
Owner

@davistan Be aware I'm likely to include a breaking change of this feature in the next major release, see #291.

@KennethanCeyer
Copy link

I hope you include these fixes ASAP.

Thank you.

@KennethanCeyer
Copy link

I faced same problem and solved this problem.

I can solve this problem to downgrade uglify-js to v2.8.10.

# Delete uglify-js@3.0.x
$ npm uninstall uglify-js --save-dev

# Re-install that plugin v2.8.10 version
$ npm install uglify-js@2.8.10 --save-dev

@terinjokes
Copy link
Owner

@KennethanCeyer if you're not using a specific version of UglifyJS, you don't have to install it: by default you'll get the latest version of UglifyJS2 and you can use the normal import.

@KennethanCeyer
Copy link

@terinjokes

I understand and now checked gulp-uglify has dependency uglify-js@2.8.10

I had mistake, i installed uglify-js directly.

I hope this comment will be helped who have faced same error.

@daviddias
Copy link

@KennethanCeyer for me that wasn't the full solution as it would disable me from using ES6 features.

I had to install uglify-js on this specific commit: "uglify-js": "github:mishoo/UglifyJS2#7906033e82d66f2735f8626e98f0f7352d9b3d25", - ref https://github.com/dignifiedquire/aegir/pull/130/files

Hope this helps for ES6 users out there :)

@terinjokes
Copy link
Owner

@diasdavid If you install from my "three" branch, you can use uglify-es, but as I noted in a comment above, the API will likely change tonight (before I do a release of gulp-uglify@3)

@daviddias
Copy link

thanks @terinjokes. I'll keep posted :)

@gluttonman
Copy link

@terinjokes Today, i use uglify-js@3.0 that has a feature {ie8:true}.But, gulp-uglify unsupport this property.because gulp-uglify property {fromString:true} that uglify-js@3.0 unsupport!

@terinjokes
Copy link
Owner

@gluttonman you can install an alpha version of gulp-uglify@3 from the "three" git branch.

@gluttonman
Copy link

@terinjokes thank you!

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

No branches or pull requests

5 participants