我将 MVC4 升级到了 MVC5,现在我所有以 .min
或 .debug
结尾的文件都不包含在 bundle 中。在 MVC4 中,bundles.IgnoreList.Clear();
有帮助,但现在不再了。
public static void RegisterBundles(BundleCollection bundles) {
bundles.IgnoreList.Clear();
bundles.Add(new ScriptBundle("~/bundles/library")
.IncludeDirectory("~/Scripts/Libraries", "*.js", true));
}
如何使其不忽略 MVC5 中的 .min
和 .debug
文件?
最佳答案
似乎无法将 file.min.js
包含到 bundle 中。但 file-min.js
、file-debug.js
和 file.debug.js
仍然有效。
查看此demo project
注意:项目使用包:
关于c# - MVC 5 bundles.ignoreList.Clear 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26991751/