There are many tools out there to "compress" more or less javascript files by mangling variable names, removing comments, etc...
But how to "tell" them to NOT process a part of a file, from this file. I need to "tell" them somehow, by even rewriting that part another way, or putting some tags in comments, ... to NOT process some parts of my files.
The easiest but very ugly solution I found was to put my code in a string and eval
it. But if there is any other solution I'd love to know it because eval
is UGLY!
UPDATE:
please due to my requirements, those are not possible answers:
- the file HAVE to be minified
- it needs to be done FROM WITHIN the source code
Edit, Updated
Tried utilizing comments at
yuicompressor
?See Comment Starting with /*!, gist , Online JavaScript/CSS Compressor
Try
See Degrading Script Tags