您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

捆绑软件不包括.min文件

捆绑软件不包括.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 code
     }
其他 2022/1/1 18:15:14 有609人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶