ASP.NET MVC 4 ScriptBundle returns empty

前端 未结 1 676
礼貌的吻别
礼貌的吻别 2021-02-14 14:39

Specifically, I am trying to create a ScriptBundle in MVC 4 with already minified scripts, and return this same Bundle whether the project is in Debug or not.

My web pro

相关标签:
1条回答
  • 2021-02-14 15:06

    I think you have the same problem, please look at this link: mvc4 bundler not including .min files

    Either rename .min.js to .js or do something like:

        public static void AddDefaultIgnorePatterns(IgnoreList ignoreList)
        {
            if (ignoreList == null)
                throw new ArgumentNullException("ignoreList");
    
            ignoreList.Clear();
    
            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);
        }
    
    0 讨论(0)
提交回复
热议问题