gpt4 book ai didi

Asp.net mvc bundle 。结合起来效果很好。但压缩和缩小不起作用

转载 作者:行者123 更新时间:2023-12-02 05:21:10 24 4
gpt4 key购买 nike

我所有的 javascript 和 css 结合在一起。但当我看时,它们并没有缩小。我不知道为什么。

我的 bundle 如下所示:

         bundles.Add(new Bundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery-ui.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/grid.locale-tr.js",
"~/Scripts/jquery.jqGrid.js",
"~/Scripts/bootstrap.js",
"~/Scripts/messages_tr.js",
"~/Scripts/jquery.form.js"
)
);
bundles.Add(new Bundle("~/bundles/mainjs").Include(
"~/Scripts/jquery-1.10.2.js",
"~/Scripts/bootstrap.js",
"~/Scripts/superfish.js",
"~/Scripts/jquery.flexslider.js",
"~/Scripts/jquery.kwicks-1.5.1.js",
"~/Scripts/jquery.easing.1.3.js",
"~/Scripts/jquery.cookie.js",
"~/Scripts/touchTouch.jquery.js"
)
);

bundles.Add(new Bundle("~/bundles/allcss").Include(
"~/Content/Css/bootstrap*",
"~/Content/Css/opa-icons.css",
"~/Content/Css/charisma-app.css",
"~/Content/Css/ui.jqgrid.css",
"~/Content/Css/jquery-ui.css"
)
);

bundles.Add(new Bundle("~/bundles/maincss").Include(
"~/Content/Css/bootstrap.css",
"~/Content/Css/responsive.css",
"~/Content/Css/style.css",
"~/Content/Css/touchTouch.css",
"~/Content/Css/kwicks-slider.css"
)
);

我的全局 asax 如下所示:

        protected void Application_Start()
{
#if DEBUG
BundleTable.EnableOptimizations = false;
#else
BundleTable.EnableOptimizations = true;
#endif
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);

GlobalConfiguration.Configuration.MessageHandlers.Add(new CorsHandler());
}

还有:

 @System.Web.Optimization.Scripts.Render("~/bundles/mainjs")
@System.Web.Optimization.Styles.Render("~/bundles/maincss")

最佳答案

它们没有缩小,因为您使用的是 Bundle 而不是 ScriptBundle。 Bundle 仅 bundle 它们(嘿,一句话概括:))ScriptBundle bundle 并缩小。

关于Asp.net mvc bundle 。结合起来效果很好。但压缩和缩小不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18454593/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com