Organising Javascript Files in Visual Studio
Int开发者_高级运维erested how others are organising their scripts in Visual Studio ?
Currently, the project I am working on has a large number of scripts and getting confused how to organise them into an arrangement without something like
<% if (Helper.IsDebug()) { %>
<%=SOME SCRIPT%>
<% } %>
<% if (Helper.IsRelease) { %>
<%=SOME SCRIPT%>
<% } %>
all over the place? Is there some easy way to organise scripts [or some tool] that allows easy packing, minification etc on release build ?
Thx
This article describes a good solution for what you are trying to do:
http://encosia.com/2009/05/20/automatically-minify-and-combine-javascript-in-visual-studio/
Essentially, for a Release mode build, you would create a pre-build event that does the combining and minification using one of the popular, free compression tools (like YUI Compressor).
精彩评论