title: How can I add the result of an ASP.NET MVC controller action to a Bundle?
body: <p>I have a controller action that returns Javascript file. I can reference this file from my view and it works fine. I'd like to put it in a System.Web.Optimization.Bundle with the other JS files.</p>
  
  <p>I'm trying to do this, essentially:</p>
  
  <pre><code>new Bundle().Include("~/DynamicScript/UrlDictionary");
  </code></pre>
  
  <p>The other files in my Bundle get rendered just fine, but this one is ignored. Seeing this behavior, my assumption is that bundling gets handled before the application is able to resolve URLs through the routing infrastructure, or maybe that the bundling component doesn't request files in a manner that would allow that resolution to happen.</p>
  
  <p>If someone could confirm that for me and/or point me in a good direction here, it would be much appreciated.</p>