ASP.NET MVC4 Bundle a single file
问题 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 minification and let MVC append a hash on to the end of the URL for caching purposes. I've tried the @Scripts.Url("~/Scripts/myscript.js") but it doesn't appear to work. 回答1: Well, define a bundle containing only this file in your bundle config: bundles.Add( new ScriptBundle("~/bundles/myscript").Include("~/Scripts/myscript.js")