I have recently switched from using a hand written compile script and Google Closure Compiler to using Brunch, where I am more or less forced into using UglifyJS.
I have the config options
uglify:
mangle:
toplevel: true
eval: true
functions: true
compress: true
My classes use the prototype style of being built.
ie.
function Car() { }
Car.prototype.startEngine = function() { }
and then (c is in global scope and called once)
var c = new Car();
car.startEngine();
Adding the toplevel:true config option mangles Car, but none of the prototype functions (ie. startEngine) are mangled.
I would like to not change my class structure, but can I get UglifyJS to mangle these function names?
Thanks :)