Showing posts with label yui compressor. Show all posts
Showing posts with label yui compressor. Show all posts

Tuesday, June 3, 2008

YUI Compressor wishlist

Ok, so my list is currently composed of only one item: Flag for always remove. YUI Compressor already has a flag to *never* remove /** comments **/ that probably contain copyright information. I'd like it if YUI Compressor had a flag to *always* remove a block of code. Use case: remove debug statements. Perhaps it could be implemented as comments that demarcate the debug block, such as:



/** debug **/
console.dir( myObj );
/**/




and a corresponding YUI Compressor command-line argument "-rmdebug"




$ java -jar yuicompressor-2.5.2.jar -rmdebug script.js -o script-min.js





Update: Ok, so.. after I posted this, I searched the yuicompressor feature request list, and natch, somebody requested this - at least the debug-one-liner version: treat as debug any line that is prefixed with ";;". YUI Compressor Feature Request: remove debug code.




;; console.dir( myObj ); //double-semicolon prefix indicates this line is for debugging