Can I do something like this in the markup of an asp.net page, based off the \"Define DEBUG constant\" setting?
#IF (DEBUG) THEN
If you are trying to step through javascript or prefer to minify javascript when not debugging, I prefer this approach:
<% if (Debugger.IsAttached) { %>
<% } else { %>
<% } %>
I can easily step through code when I am debugging, otherwise I want the scripts to be minified. Be sure to include the following import:
<%@ Import Namespace="System.Diagnostics" %>
Moreover, it is nice to use the Web Essentials visual studio extension to bundle/minify your javascript files so that there is only one request made to the server for your scripts.