I have put below mentioned knockout js reference inside the _Layout.cshtml file.
<script src="@Url.Content("~/Scripts/knockout-2.2.0.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/knockout-2.2.0.debug.js")" type="text/javascript"></script>
I have put debug.js file only for intellisense support inside the visual studio 2010.
My Question is :
How to avoid debug.js file is being down loaded for client when I published my application.In other words restrict debug.js file only for the development environment(not for the client side download).
How to do that in ASP.NET ?
A common approach is to have a flag indicating e.g.
DEVELOPMENT_MODE = true;. Then wrap the<script>declaration with logic that checks that flag, and only includes the script if it’s true.I’m not a
.netperson, but in PHP something like:Of course, prior to deploying your app you’d set
DEVELOPMENT_MODEto false (either manually or via Ant, etc).Cheers