the resulting code with grunt-remove-logging with default options is:
var x=function(b){a.console&&a.};
which gives a syntax error.
I know "replaceWith" can be used to replace the deleted statement with something else, but that doesn't help in this case (from a general point of view). The option "namespace" is also not good enough since I might not know before hand what the actual namespace is for pre-minified imported libs. Therefore, an additional option could be to match all leading namespaces, such that the following options:
[feature request]
Some js libraries access console via the window namespace (which sometimes get minified to a one letter variable by uglyfier tools) as below:
e.g. isotope.js: http://isotope.metafizzy.co/jquery.isotope.min.js
the resulting code with grunt-remove-logging with default options is:
which gives a syntax error.
I know "replaceWith" can be used to replace the deleted statement with something else, but that doesn't help in this case (from a general point of view). The option "namespace" is also not good enough since I might not know before hand what the actual namespace is for pre-minified imported libs. Therefore, an additional option could be to match all leading namespaces, such that the following options:
would turn the example above into:
possible regexp: