rendering absolute URLs for bundled/unbundled scripts

Apr 21, 2013 at 2:10 AM
I have one issue with the bundling feature- it only renders application absolute paths in the src attribute of the rendered script elements. I am unable to use another hostname in the rendered url, to take advantage of what Chrome recommends when I run a audit on my site. They talk about how using urls with different host names will allow for faster download of scripts, if there are a lot of resources the path references.

I would like to request an optional property where I can set the hostname, like "", and the @Scripts.Render helper accept that property when generating the output(depending on whether minification is enabled by BundleTable.EnableOptimizations = true, or in Release mode).

Would like to have
@Scripts.Render("~/bundles/js", "")
and the result be
<script src=""/> or if bundling not enabled
<script src=""/> <script src=""/> don't think this would be very difficult to enable? If I had access to the source code, I could do this myself, but I don't, so I'm putting in this request.

Jul 24, 2013 at 4:48 PM
i need something similar on my projects. I need that Scripts.Render generate the full url to the file. The reason i need this is because my web site is calling an API on another site. This API need to return my the url to a javascript file that is hosted there so it need to be a full url!

Presently, if my site is on "" and i use Scripts.Render("~bundles/js"), this is what i get:
<script src="/bundles/js" />
the result that i want would be this:
<script src="" />
Mar 27, 2014 at 8:03 PM
Edited Mar 27, 2014 at 8:59 PM
I too need something similar, my case is only slightly different:

If my site is hosted on "" and i use Scripts.Render("~bundles/js"), this is what i get:
<script src="/myapp/bundles/js?v=RYQkGlZ5kEreOyiFPLgJ2SkEJtBEjiJQ6NeuVTYwXMY1"></script>
<link href="/myapp/css?v=1FC5SbQ1-E0J4ZXC1coG1W09-2uMUsJx0S1y_amIU3U1" rel="stylesheet"/>
Instead, if through some DNS magic we can enable the user to use the URL http://shorterurl, I would like the script/style bundles to render URLs like this:
<script src="bundles/js?v=RYQkGlZ5kEreOyiFPLgJ2SkEJtBEjiJQ6NeuVTYwXMY1"></script>
<link href="bundles/css?v=1FC5SbQ1-E0J4ZXC1coG1W09-2uMUsJx0S1y_amIU3U1" rel="stylesheet"/>
Is there a workaround for this?