minify - Statistics on renaming via JavaScript minifier -


i new minification of javascript. setting of problem:

assuming have original javascript code , minified code a′ (which generated minifier uglifyjs or closure compiler), how can i:

  1. count number of variables have been renamed, ,

  2. map every variable's original name minified name

any detailed instructions welcomed, tool uglifyjs or closure compiler better :)

there 2 approaches:

1) closure compiler can produce "renaming map" both properties , variables. map not include unrenamed variables there still work do. see --variable_renaming_report command-line option https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/commandlinerunner.java#l215.

2) closure compiler , other tools produce source maps. source map can used map every byte original character in original.

for second closure compiler project includes java library reading source maps: https://github.com/google/closure-compiler/blob/master/src/com/google/debugging/sourcemap/sourcemapconsumerv3.java#l225

there exist javascript source map utilities: https://github.com/mozilla/source-map/


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -