title: Dynamic/Automatic Javascript and CSS Combining and Minification
body: <p>I know I have seen an article this somewhere (specifically related to Azure too!) but I forgot to bookmark it (doh!) and after hours searching can't find it anywhere :(</p>
  
  <p>I have a MVC Application running in Azure with multiple layout pages and roughly 20+ javascript files (each quite lengthy hence why they are seperate!).</p>
  
  <p>Each layout page includes a couple of script and css files, the rest are added using <code>@head { }</code> (razor syntax for adding sections to the layout page outside of the body.</p>
  
  <p>I cannot remember if the article was exactly what I was after but what I would like to do is combine AND minify the nessessary javascript and css files at runtime dependant on the layout and page.</p>
  
  <p>For example if i had a layout file with:</p>
  
  <pre><code>&lt;script src="script1.js"&gt;&lt;/script&gt;
  &lt;script src="script2.js"&gt;&lt;/script&gt;
  &lt;link href="css1.css" /&gt;
  </code></pre>
  
  <p>and a page with</p>
  
  <pre><code>&lt;script src="pagespecificscript.js"&gt;&lt;/script&gt;
  &lt;script src="usercontrolspecificscript.js"&gt;&lt;/script&gt;
  &lt;link href="page.css" /&gt;
  </code></pre>
  
  <p>I would want a 2 minified files to be sent to the user's browser such as</p>
  
  <pre><code>&lt;script src="201101010800abc-min.js"&gt;&lt;/script&gt;
  &lt;link href="201101010800abc-min.css" /&gt;
  </code></pre>
  
  <p>Thanks in advance!</p>