-
-
Notifications
You must be signed in to change notification settings - Fork 158
Make uglify a target #134
Comments
Using Babili, I can't get my node targeted build to even come close to what Uglify produces, some of this has to do with the order of execution in Webpack. Running Babili after the project is built causes a heap exception (known issue with very large projects). I've looked at doing AST transforms myself, but the complexity of operations is introducing concerns (properly hoisting variables requires checking if the declaration is a type of Literal and conditionally replacing/removing/adding assignments). Using Acorn with Uglify doesn't make any difference and I can't get the Harmony branch of Uglify to work (too many bugs). Targeting Uglify would be an intermediate patch, but what's really desired is a proper ES6 compatible Uglify. Still +1 on this request, let me know if you have any other suggestions - maybe some of what I've said is useful for you as well. |
also my intent is to do this for uglify 2 (not harmony) and then working on making Babili better |
Understood, I'm stating this feature is only useful because Uglify doesn't fully support ES6 and Babili has less transforms than Uglify. On a side note, I started writing code for hoisting variables (w/ Babel AST). I left off at handling logic for literals/assignment; I can share that if you'd like to take a look at it, I'm sure there are better methods to manipulate the AST than I was using. |
Hi, any news? |
@OlegLustenko Hi! I've decided to solve it after your comment and it works ok, but I need to write some tests and to make up my mind what to do with uglify/harmony. Going to send PR in the morning with a fresh mind. Seems like we have the same timezone ;) |
Thanks :) |
Going to work on this now
If you use minification already (uglify) then targeting later browers and compiling less would be useful because it will syntax error. I thought at the very least we could have an option to only check polyfills with a
targetBuiltInsOnly
option but makinguglify
its own target makes way more sense.Of course I will be integrating/try https://github.com/babel/babili so that option wouldn't be needed
The text was updated successfully, but these errors were encountered: