栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

捆绑软件不包括.min文件

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

捆绑软件不包括.min文件

我最初发布的解决方案是有问题的(很脏)。正如许多评论者所指出的那样,Microsoft.AspNet.Web.Optimization包中的调整行为已更改,并且该调整不再起作用。目前,该软件包的版本1.1.3根本无法重现该问题。

请参阅System.Web.Optimization.BundleCollection的资源(例如,您可以使用dotPeek)以更好地了解您将要做什么。另请阅读Max
Shmelev的答案

原始答案

将.min.js重命名为.js或执行类似的操作

    public static void AddDefaultIgnorePatterns(IgnoreList ignoreList)    {        if (ignoreList == null) throw new ArgumentNullException("ignoreList");        ignoreList.Ignore("*.intellisense.js");        ignoreList.Ignore("*-vsdoc.js");        ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);        //ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);        ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);    }    public static void RegisterBundles(BundleCollection bundles)    {        bundles.IgnoreList.Clear();        AddDefaultIgnorePatterns(bundles.IgnoreList);        //NOTE: it's bundles.DirectoryFilter in Microsoft.AspNet.Web.Optimization.1.1.3 and not bundles.IgnoreList        //...your pre     }


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/433104.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号