Open Stefano-Sega opened 7 years ago
Yep I can confirm is due to the fact that "lazyload.js" and "lazyload.min.js" are in ES6 and not transpilled, and since in my webpack configuration I excluded all node_modules from babel transpill (generally node_modules files come already transpiled and so devs exclude them from webpack plugins pre-processing) the ES6 file generate error with UglifyJS
How can one bypass this error in uglifyJS?
Wonders of JavaScript. However uglify-es should be able to minify ES6.
I've tried it, it does. But i causes many many problems with es5, and any other js libraries in my project. Append does the trick. Also there are problems on firefox with this lazy load.
Not sure what you mean with append?
I've worked it out like this: https://www.npmjs.com/package/gulp-append
Using uglify-es with other scripts causes them to break. I minify all to one .js file. If someone doesn't mind putting more requests to their site uglify-es works fine with your lazy load.
Installed uglify-es, still:
ERROR in vendor.min.js from UglifyJs
Unexpected token: name (extended)
@s0By ,me too. How to deal with it
This fixed it for me: (using uglify-es with gulp-uglify) https://stackoverflow.com/a/47339387
Hello!
I'm using LazyLoad as a jQuery extension:
Everything works perfectly, but when I try to bundle all the JS with webpack and its own Uglify plugin I get the error
and the error is thrown at the last of the lines of code here below:
Seems an issue with ES6 not being uglified, could be?