本文简单讲一下mvc4中关于前端的一个新功能——js与css的压缩与合并。BundleConfig.cs就是用来配置这些css、js的。
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.*"));
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
这两个就是配置js路径跟css路径,当然路径可以有多个,Include传递的参数为数组,可以把要添加的js跟css都放上去。例bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"," /Content/themes/default/typography.css"));