asp.net-mvc – 不要在ASP .NET MVC 4 BundleConfig中缩小某些文件
发布时间:2020-12-05 04:44:37 所属栏目: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-3 – Telerik MVC网格,在运行时从集合或字典中
- asp.net-mvc – 从扩展Apicontroller的MVC控制器返回Json
- ASP.NET汉字转拼音 - 输入汉字获取其拼音的具体实现
- .net – IIS 6.0和ASPX中的404自定义错误不起作用
- asp.net – MVC 4导出到CSV – 另存为对话框在Chrome和Fire
- asp.net-mvc – 在MVC命令,优先级和功能问题中授权属性
- asp.net-mvc – 将DropDownListFor绑定到字典
- 如何通过接口获取登录的用户名以在asp.net core mvc中按列插
- asp.net实现生成缩略图及给原始图加水印的方法示例
- asp.net-identity交易问题