asp.net-mvc – 不要在ASP .NET MVC 4 BundleConfig中缩小某些文件
发布时间:2020-12-05 02:47:54 所属栏目:asp.Net 来源:互联网
导读:我不想在我的ASP.NET MVC 4解决方案中使用我所有的文件.所以例如我在BundleConfig.cs中有这个: bundles.Add(new StyleBundle(~/CSS/bootstrap).Include( ~/Content/Bootstrap/body.css, ~/Content/Bootstrap/bootstrap-responsive.cs
我不想在我的ASP.NET MVC 4解决方案中使用我所有的文件.所以例如我在BundleConfig.cs中有这个: bundles.Add(new StyleBundle("~/CSS/bootstrap").Include( "~/Content/Bootstrap/body.css","~/Content/Bootstrap/bootstrap-responsive.css","~/Content/Bootstrap/bootstrap-mvc-validation.css","~/Content/Bootstrap/bootstrap-theme.css","~/Content/Bootstrap/bootstrap.css" )); ... 而且为了减少它,当然我使用: BundleTable.EnableOptimizations = true; 所以它的效果很好. 但是现在,除了一个捆绑包之外,我该怎么缩小我的所有文件?我有一个bundle的问题,删除一些CSS类,并且不想减少这个. 任何帮助将不胜感激. 解决方法使用Transforms.Clear()来跳过缩小,但保持文件捆绑//declare bundle var bundle = new ScriptBundle("~/javascripts/ckEditor") .Include("~/Scripts/ckeditor/ckeditor.js") .Include("~/Scripts/ckeditor/config.js"); //skip transformation. Result is that files are only bundled,but not minified. bundle.Transforms.Clear(); bundles.Add(bundle); 您还必须从目录中删除.min.js文件以防止替换 (编辑:鄂州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 部署 – kestrel-hellomvc.service:步骤USER产生失败/usr/
- asp.net简单生成XML文件的方法
- c#中分布方法和分部类
- asp.net – 绑定ListView InsertItemTemplate中的DropDownL
- asp.net-mvc – 在ASP.NET MVC 2中模板化Html.DisplayFor()
- asp.net – Ajax Control Toolkit正在加载太多脚本资源
- 在ASP.NET MVC4中是否可以将C#或VB函数标记为Javascript?
- ASP.NET中的应用程序生存期
- 强烈推荐的一个工具ReSharper
- 在ASP.NET MVC中动态地从数据库生成CSS文件
推荐文章
站长推荐
- asp.net repeater手写分页实例代码
- asp.net – Telerik RadGrid GridDataItem – 如
- asp.net – 如何添加.aspx页面到现有的MVC 4项目
- asp.net – 如何在页面加载时以“添加新”模式进
- asp.net-mvc – DropDownListFor在编辑视图上不重
- ASP.NET Web应用程序本地化的最佳实践
- asp.net-mvc-2 – 如何在ASP.NET MVC2中为Html.L
- asp.net-mvc – 如何锁定ASP.NET MVC中的路径?
- asp.net – Web部署项目的更好替代品
- asp.net中利用Jquery+Ajax+Json实现无刷新分页的
热点阅读