asp.net-mvc – 不要在ASP .NET MVC 4 BundleConfig中缩小某些文件
发布时间:2020-12-05 02:40:00 所属栏目: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文件以防止替换 (编辑:十堰站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 来自ASP.NET MVC站点的“无效的JSON原语:alihack”错误
- asp.net – visual studio 2017调试无法启动程序无效指针
- asp.net core webapi 服务端配置跨域的实例
- 如何处理在MVC视图中应用程序启动和传输和显示错误发生的AS
- asp.net-mvc-4 – 如何在Kendo UI Grid中扩展页面加载时的所
- asp.net – 在Web.config帮助中定义tagPrefixes
- asp.net – Visual Studio – 为什么.ASPX文件比.ASPX.CS文
- asp.net-mvc – 当我不知道内容类型时如何返回文件结果
- asp.net – WebBrowsable vs个性化Web部件
- asp.net-mvc – 有条件地在webgrid中显示图像 – mvc 3
推荐文章
站长推荐
- asp.net – 无法返回JsonResult
- 并行运行ASP.NET Webforms和ASP.NET MVC
- 将ASP.NET应用程序本地化为普通话
- ASP.NET MVC编辑器模板和Html.EditorFor(…) –
- 如何在ASP.NET Web应用程序中打开一个SectionGro
- asp.net – WebBrowsable vs个性化Web部件
- asp.net – 通过Web服务访问连接字符串
- asp.net – 无法加载文件或程序集System.Web.Htt
- asp.net-mvc-2 – 如何在ASP.NET MVC2中为Html.L
- asp.net-mvc – 使用AD的ASP.NET MVC表单Auth在本
热点阅读