仍然不能使用 Asp.net Bundles!
在Global.asax.cs
BundleConfig.RegisterBundles(BundleTable.Bundles, Server);
和 ...
public static void RegisterBundles(BundleCollection bundles, HttpServerUtility server)
{
bundles.IgnoreList.Clear();
AddDefaultIgnorePatterns(bundles.IgnoreList);
...
var scriptBundle = new ScriptBundle("~/Scripts")
.IncludeDirectory("~/Scripts", "*.js");
bundles.Add(scriptBundle);
忽略列表
private static void AddDefaultIgnorePatterns(IgnoreList ignoreList)
{
ignoreList.Ignore("*.intellisense.js", OptimizationMode.Always);
ignoreList.Ignore("*-vsdoc.js", OptimizationMode.Always);
ignoreList.Ignore("*.debug.js", OptimizationMode.Always);
ignoreList.Ignore("underscore.js", OptimizationMode.Always);
ignoreList.Ignore("moment.js", OptimizationMode.Always);
ignoreList.Ignore("jquery-{version}.js", OptimizationMode.Always);
}
不过,像这样jquery.pnotify.min.js
的文件不会被渲染!
套餐
WebGrease 1.3.0 Microsoft.AspNet.Web.Optimi... 1.1.0-Beta1