2
当我添加的jQuery UI来捆我结束了:CSS捆绑和Internet Explorer的限制
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"
Internet Explorer有一个limit 31的样式表将加载,其中的jQuery采取了12加在yui重置,基本和字体我已经在15个样式表,没有任何网站样式或插件样式表加载。
显然,一切都很好,因为只有一个样式表生成时,它被捆绑。我的第一个直觉是使用那些使用@Import的,但导致捆绑到fall over或不缩小。
这是什么是最好的解决方法,除了更少的样式表? 我目前的解决方案是#if DEBUG
结构,但有没有更好的方法?
#if DEBUG
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/themes/base/jquery.ui.all.css"));
#else
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"));
#endif
缩小器将不会走向@imports提供更大的css文件大小。 – NikolaiDante
那么在这种情况下,你的解决方法似乎可以接受。 –