last day (14 days later) » 

4:39 AM
0
Q: uglifyjs2 just mearge files without mangling

naveen23I have bunch of angular code. I dont want to mangle the code but just want to remove the whitespaces and mearge them. Tried bunch of options , but all of them were mangling the code.

 
Can you show your latest set of options?
 
xargs cat | uglifyjs -c -m -o /tmp/lib/a4.min.js /usr/bin/uglifyjs:228 if (err) throw err; ^ Error: ENOENT, open '-m' xargs: cat: terminated by signal 13
 
Have you tried getting rid of the -m arg?
 
still manges the names,, since using angular.js .. i don't want to mangle
 
Weird. Are you open to using Node.js with grunt and grunt-contrib-uglify? I've used that to minify my Angular code without mangling it. But of course that would be a lot of additional work that shouldn't even be necessary...
 
4:39 AM
just using node.js .. whitout grunt. Also tried just -o.. even that was mangling it
 
Do you know about the trick to allow angular.module and such to work even with mangled parameter names?
 
Hi .. Troy
nopes
 
Hello! SO told me to move this to chat. I guess they don't like long comment threads.
 
are you using uglifyjs2
what options work for you
to just mearge files
without mangling
 
I'm using grunt-contrib-uglify. I've never tried uglifyjs or uglifyjs2
anyway the "trick" to allow mangled parameter names to not break Angular is this...
Instead of the basic declaration like so: .controller("mainController", function($scope, cgApiService) {
Wrap the function in an array, preceded by the args as strings, like so: .controller("mainController", ["$scope", "cgApiService", function($scope, cgApiService) {
 
4:46 AM
ok .. let me try that ..
but what abt libs
that have already defined it this way
actually i am just looking to completely disable mangling
 
yeah i agree disabling mangling would be far easier. i wish i knew why it was doing it even without the -m arg.
let me know if you want me to delete any of my comments on your question, so people don't read them and think that maybe we got it figured out offline or something
 
right .. pls delete
thanks for your time sir
 
sure, sorry none of it helped
 

last day (14 days later) »