1

This is similar question to this Uglify-js doesn't mangle variable names but I run uglify-js from command line, I've try to call with --mt option like this:

 uglifyjs -o jquery.terminal.min.js --comments --mt -- jquery.terminal.js

but I've got this as result:

(function(ctx){var sprintf=function(){if(!sprintf.cache.hasOwnProperty(arguments[0])){sprintf.cache[arguments[0]]=sprintf.parse(arguments[0])}return sprintf.format.call(null,sprintf.cache[arguments[0]],arguments)};

but on the site I've got this as result:

!function(a){function d(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function e(a,b){for(var c=[];b>0;c[--b]=a);return c.join("")}var b=function(){return b.cache.hasOwnProperty(arguments[0])||(b.cache[arguments[0]]=b.parse(arguments[0])),b.format.call(null,b.cache[arguments[0]],arguments)};
Community
  • 1
  • 1
jcubic
  • 61,973
  • 54
  • 229
  • 402

1 Answers1

2

It seems that there is undocumented (in README on github) option --mangle:

uglifyjs -o terminal.min.js --comments --mangle -- jquery.terminal-0.10.7.js
jcubic
  • 61,973
  • 54
  • 229
  • 402
  • It actually is documented [in the UglifyJS2 repo](https://github.com/mishoo/UglifyJS2), it's just not in UglifyJS1's – Jay Jul 20 '16 at 04:03