Pretty Print

Modified on 2009/12/15 20:49 by Stephen Walther — Categorized as: Uncategorized

Sometimes you need to debug your minified code. Trying to debug a single line of JavaScript thirty thousand characters long will drive you crazy – if your debugger can even handle it. Enter the -PRETTY option. It is recommended to use this option in your debug build process. It will perform all the same minification, but instead of outputting all the code on a single line, it will be output it all in an easy-to-read multi-line format. The default indent size is four space characters; to change that size, specify the numeric size of the indent on the –PRETTY switch, separated by a colon. For instance, to use only two spaces per indent level: -PRETTY:2.

For JavaScript, using the –PRETTY option will turn off local variable- and function- renaming unless explicitly turned on by using the –RENAME command-line switch.

When using the DLL API, the Pretty Print option is controlled via the OuputMode and IndentSize properties on the CodeSettings object.

The –PRETTY switch works with both JavaScript and CSS.