title: ASP.NET Mvc 4 Use bundle's benefits for Url.Content
body: <p>Is there any way I can do this?</p>
  
  <p>Some of the benefits of bundling are:</p>
  
  <ul>
  <li>Minimization</li>
  <li>Gzip compression</li>
  <li>The request has a token parameter for handling files versiones (cache).</li>
  </ul>
  
  <p>In my site I use a lot of bundles, but in some pages I only have 1 script and I don't think I should create a bundle only for 1 script. Is there any way I can use this three benefits with <code>Url.Content</code> method.</p>
  
  <p>My utopic solution would be to set up something (maybe in the web.config) and whenever Url.Content is called it adds this functionality. Using it in either of this ways:</p>
  
  <pre><code>&lt;script type="text/javascript" src="@Url.Content("~/Scripts/...")"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="~/Scripts/..."&gt;&lt;/script&gt;
  </code></pre>
  
  <p>(The second one is because I'm using <a href="http://vibrantcode.com/blog/2012/4/10/whats-new-in-razor-v2.html/" rel="nofollow">Razor 2</a>)</p>
  
  <p>If that is not possible I can make an extension method to UrlHelper to add this functionality.</p>
  
  <p>Thanks!</p>