Пакеты JS не отображаются без параметра EnableOptimization, установленного в true
Я нене знаю, если яя делаю что-то не так, но этоВероятно, ошибка внутри MVC4. Интересно, как я могу это исправить?
Рабочий сценарийpublic class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
ScriptBundle scriptBundle = new ScriptBundle("~/js");
string[] scriptArray =
{
"~/content/plugins/jquery/jquery-1.8.2.min.js",
"~/content/plugins/jquery/jquery-ui-1.9.0.min.js",
"~/content/plugins/jquery/jquery.validate.min.js",
"~/content/plugins/jquery/jquery.validate.unobtrusive.min.js",
"~/content/plugins/bootstrap/js/bootstrap.min.js",
};
scriptBundle.Include(scriptArray);
scriptBundle.IncludeDirectory("~/content/js", "*.js");
bundles.Add(scriptBundle);
BundleTable.EnableOptimizations = true;
}
}
@Scripts.Render("~/js")
Преобразование в (например, это работает!)
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
ScriptBundle scriptBundle = new ScriptBundle("~/js");
string[] scriptArray =
{
"~/content/plugins/jquery/jquery-1.8.2.min.js",
"~/content/plugins/jquery/jquery-ui-1.9.0.min.js",
"~/content/plugins/jquery/jquery.validate.min.js",
"~/content/plugins/jquery/jquery.validate.unobtrusive.min.js",
"~/content/plugins/bootstrap/js/bootstrap.min.js",
};
scriptBundle.Include(scriptArray);
scriptBundle.IncludeDirectory("~/content/js", "*.js");
bundles.Add(scriptBundle);
// BundleTable.EnableOptimizations = true; // I could set it to 'false' for same result, it's false by default
}
}
@Scripts.Render("~/js")
Преобразование в (например, это не работает!)(nothing, couple of empty break lines)