【发布时间】:2021-07-08 20:03:46
【问题描述】:
我一直在尝试使用 ASP.NET MVC 4.6 Bundle Config 来捆绑和缩小我的本地 CSS 和 JS 文件。 我已尝试使用以下代码进行 CSS 捆绑:
public static void RegisterBundles(BundleCollection bundles)
{
bundles.IgnoreList.Clear();
bundles.Add(new StyleBundle("~/Content/css/bundleStylesheets").Include(
"~/Content/css/custom-select.css",
"~/Content/css/main.css",
"~/Content/css/homepage.css",
"~/Content/css/asset-preview.css",
"~/Content/css/casestudy.css",
"~/Content/css/admin.css",
"~/Content/css/judgework.css",
"~/Content/css/submissions.css",
"~/Content/css/gallery.css"));
BundleTable.EnableOptimizations = true;
}
这将创建一个捆绑 CSS 文件。但是,捆绑文件未缩小。我想知道这是否可能。
谢谢,
【问题讨论】:
标签: c# asp.net-mvc bundle minify