I have a js file that contains lots of debug statements. I am looking for a script or compiler that will skip these debug statements, and can provide a production version.
function init(){
console.log('initing the lib');
...
.. some code here ..
...
console.log('init over');
}
I need to have a production version that has none of these console.log’s. This will allow for writing a debug version that can be used to see where exactly the error is occuring.
Maybe googles closure compile can help you out?
If you’re worried about the
console.log(seems that’s what you mean by ‘debug statements’), it may be an idea to override it in production: