asp.net-mvc – 不要在ASP .NET MVC 4 BundleConfig中缩小某些文
发布时间:2020-12-15 20:26:27 所属栏目:asp.Net 来源:网络整理
导读:我不想在我的ASP.NET MVC 4解决方案中使用我所有的文件.所以例如我在BundleConfig.cs中有这个: bundles.Add(new StyleBundle("~/CSS/bootstrap").Include( "~/Content/Bootstrap/body.css","~/Content/Bootstrap/bootstrap-responsive.css","~/Content/Boot
我不想在我的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 – 为什么Visual Studio 2010混合了System.Web
- asp.net-mvc – Action方法中的routeValues不接受ExpandoOb
- asp.net – 动态创建和共享Google云端硬盘文件夹
- EXCEL文件导入时报_未在本地计算机上注册Microsoft.ACE.OLE
- 认证 – WebApi ActionFilterAttribute,HttpActionContext访
- asp.net-mvc – Azure上的MVC4部署问题
- .net – RangeValidator不能算?
- asp.net-mvc-4 – LinkedIn在MVC4中使用DotNetOpenAuth的完
- 为什么ASP.NET接受外部创建的会话标识符?
- asp.net – 检查是否在集成管道模式
推荐文章
站长推荐
- asp.net-core – 如何在Asp.net核心服务类中调用
- 点击图片,AJAX删除后台图片文件的实现代码(asp.n
- asp.net-mvc-5 – 确认邮件中的aspnet身份无效令
- asp.net – SQL Azure不支持SqlCacheDependency?
- asp.net-mvc – ASP.Net MVC中的分页和路由
- 隐藏ASP.NET菜单项
- 奇怪的#_ = _出现在response.redirect ASP.NET之
- asp.net-mvc – 如何在asp.net mvc 3中使用@html
- asp.net-mvc – ASP MVC ChildActionOnly应该有路
- asp.net – User.Identity.GetUserId()方法无法在
热点阅读