asp.net-mvc – 不要在ASP .NET MVC 4 BundleConfig中缩小某些文件
发布时间:2020-12-05 02:26:45 所属栏目: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 – 如何检查是否为浏览器启用了cookie
- asp.net-core – 加密ASP.Net Core中的连接字符串和其他配置
- asp.net-mvc-routing – @ Url.Action获取?附加长度= 2
- asp.net-identity交易问题
- ASP.NET MVC删除操作链接确认
- asp.net – Request.Url.AbsoluteUri和重写的URL
- asp.net – 如何在Visual Studio中添加NUnit
- asp.net-mvc – ASP.NET MVC检查Controller或Action中的自定
- asp.net-mvc-4 – 在EF迁移配置类的Seed方法中获取App_Data
- asp.net-mvc – MVC“添加控制器”是“无法检索元数据…配置
推荐文章
站长推荐
- asp.net – App Settings和connectionStrings配置
- asp.net – 为什么HttpContext.Current.User.Ide
- asp.net – “线程被中止了什么”. ‘SNIReadSyn
- asp.net – 请求URL在IIS 7中无效
- asp.net – 注册.NET 4.5 IIS 10 Windows 10
- asp.net-mvc – 输出在剃刀通过变量?
- asp.net – 在Azure网站上启用gzip压缩
- asp.net – 双回发问题
- asp.net-mvc – ASP.Net MVC:如何根据原始的Jso
- Asp.Net的FileUpload类实现上传文件实例
热点阅读