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

1 comment:

  1. Speaking of compressors, we have an opportunity to develop a process to merge development js includes on my current project. I was hoping it would be some kind of maven process that was handled by who ever does the build and the front-end guys won't even notice or care that it's happening.

    Do you know anything about maven?

    ReplyDelete