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
Issue with Babel, ES6 and Uglify #146
Comments
@lewiswalsh to solve this you need to use the es2015 preset from babel (https://babeljs.io/docs/plugins/preset-es2015/) |
As noted above by @loris, this would be resolved by needing to use the es2015 Babel plugin. I'll happily accept a pull request adding this as an example recipe. 🍰 |
IMHO the use of the es2015 preset is not a proper workaround when targeting Node 4 as code will be transpiled to ES5 and not ES6! Are there any plans to reopen this task or add the proper functionality? |
I agree with @HyperBrain since I want to use ES6 code in some cases. |
@HyperBrain UglifyJS (which this plugin uses) is working on ES6 support, I have no control over their development process. Since I originally closed this issue, I've added a section to the README on how to use a different version of UglifyJS with this plugin. Some folks have had success using uglify-js-harmony. |
Nice @HyperBrain . It worked with uglify-js-harmony! Thank you very much! |
@yuricamara Thanks belong to @terinjokes :-) He made clear what to do in the README. |
Thanks @terinjokes. But, It think it needs to mention there, that uglify-js-harmony works with ES6. I will suggest an update through a PR. |
This reverts commit 9e3fe92. @freebroccolo while great in theory, this breaks uglifyjs. minification provides an important advantage in interpretation time (and therefore reduced bootup time)
@terinjokes can you provide an example of how to use uglify-js-harmony with piping or pump? I need to use
For example, this is my gulp task. I am using uglify within the pump but am getting error
|
@dtturcotte |
@terinjokes okay I decided to transpile using
Then
Full task:
This transpiles and minifies the code fine, except I get this error in browser:
More on this issue here if you can help: http://stackoverflow.com/questions/40772301/gulp-babel-with-angular-error-module-app-is-not-available |
Here is my gulp task:
And here is the error I get if I use any ES6, even a simple
let
statement. If I stick with ES5 everything works fine:A test js file that is failing:
Update
Tested on Windows 10 and Ubuntu 14.04 both with Node 4.1.2
The text was updated successfully, but these errors were encountered: