Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A couple of ideas spring to mind:</p> <p>1) Take advantage of the hotfix released to allow debug/intellisense versions of .js files: <a href="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736" rel="nofollow noreferrer">KB958502</a></p> <p>This will allow you to write (albeit one) large, fully readable js file, but refer to the full version in your script src, that can be generated during the build. The hofix enables VS to find files named "-vsdoc.js" or ".debug.js" in place of the referenced files (so you reference "/scripts/myscript.js" in your src attribute, but the IDE will first look for "/scripts/myscript-vsdoc.js", then "/scripts/myscript.debug.js", and finally it will look for "/scripts/myscript.js" - a bit more info can be found on the <a href="http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx" rel="nofollow noreferrer">Visual Web Developer team blog</a>.</p> <p>2) Others have posted on an <a href="http://www.west-wind.com/WebLog/posts/413878.aspx" rel="nofollow noreferrer">custom script managers</a> they wrote, that would reference the main version during debug, but in release mode would request the minimized version.</p> <p>3) I'm sure I read somewhere, although I can't find it at the moment, about someone who had written their own HTML helper extension method, that would generate the script call appropriately depending on the buid mode - similar process to Rick's idea, but allowing you to work in a more "usual" way, although I'm not sure how well it played out with intellisense.</p> <p>I'm leaning towards 1 at the moment - using a process similar to Nick Berardi's here: <a href="http://www.coderjournal.com/2008/05/how-to-create-a-yui-compressor-msbuild-task/" rel="nofollow noreferrer">How to create a YUI Compressor MSBuild Task</a> to generate the minimised js.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload