ASP.NET MVC 5 – remove console.log by set compilation to false

 

In Web.config

<compilation debug="false" targetFramework="4.5">

 

BundleConfig.cs

if (HttpContext.Current.IsDebuggingEnabled)
{
    BundleTable.EnableOptimizations = false;
}
else
{
    BundleTable.EnableOptimizations = true;
}

 

JS files
///#DEBUG
console.log(“your debug log here.”);
///#ENDDEBUG

 

Nice related article about remove console - http://www.elijahmanor.com/grunt-away-those-pesky-console-log-statements/

沒有留言:

張貼留言