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

Consider uglify-es by default #34

Closed
tomkel opened this issue Jul 6, 2017 · 7 comments
Closed

Consider uglify-es by default #34

tomkel opened this issue Jul 6, 2017 · 7 comments

Comments

@tomkel
Copy link

tomkel commented Jul 6, 2017

Webpack uglify plugin just started using uglify-es by default.

webpack-contrib/uglifyjs-webpack-plugin#63

@TrySound
Copy link
Owner

TrySound commented Jul 6, 2017

PR welcome

@paulocoghi
Copy link

@TrySound, since uglify-es represents the UglifyJS version 3, and its API is not backward compatible with version 2, it would be interesting to test it before merge (apparently the tests passed).

@TrySound
Copy link
Owner

This project uses uglify3

@paulocoghi
Copy link

paulocoghi commented Oct 30, 2017

Nice, thanks! In this case, is that PR apt to be approved? Or does it no longer make sense?

I'm asking this because of the warning about ES2015. Is the following approach still necessary?

import { rollup } from 'rollup';
import uglify from 'rollup-plugin-uglify';
import { minify } from 'uglify-es';

rollup({
    entry: 'main.js',
    plugins: [
        uglify({}, minify)
    ]
});

@VincentCharpentier
Copy link

Seems like ES6 is still an issue with this plugin.
Am I missing a newer plugin that should replace this one ?

The trick mentioned above is not longer possible:

uglify({}, minify) // This won't work

The uglify function takes only one options argument now

I tried @babel/preset-env with forceAllTransforms: true because the docs says:

Enable this option if you want to force running all transforms, which is useful if the output will be run through UglifyJS or an environment that only supports ES5.

But it's not working so far

@TrySound
Copy link
Owner

Yes, use this one https://github.com/TrySound/rollup-plugin-terser.
image

@VincentCharpentier
Copy link

Thanks for the quick reply, works really well now 👍

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

No branches or pull requests

4 participants