顯示具有 MVC5 標籤的文章。 顯示所有文章
顯示具有 MVC5 標籤的文章。 顯示所有文章

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/