Is there a way to bundle a single file using the new bundling features in MVC4? I know bundling a single file doesn\'t make much sense but I\'d like to use server-side minificat
I dont know, if I get you right, but you can add bundles any time you want to, just add it to the bundlecollection:
BundleTable.Bundles.Add(new ScriptBundle("~/Scripts/myBundleName").Include(
"~/Scripts/myscript.js"
));
I am not sure how you planing to include the bundle on client side, but after a bundle is registered you can get the url of the minified script file with this code:
string url = BundleTable.Bundles.ResolveBundleUrl("~/Scripts/myBundleName");
In my case I just get this url through an ajax request and create a script tag on client side. This way the script file will be minified and the url comes with an hash code, so the browser should cache it and when the bundle is changed should load the newer version.
I hope this is, what you intended to do.