gpt4 book ai didi

CSS 打包后搞砸了

转载 作者:行者123 更新时间:2023-11-28 03:49:43 29 4
gpt4 key购买 nike

我的元素中有多个 CSS 文件,我们正在捆绑这些文件。

当包含在捆绑中时,其中一个文件无法按预期工作,但取消捆绑后,它可以正常工作。

代码如下

var cssCustom = new StyleBundle("~/bundle/css")
.Include("~/Content/Kendo/kendo.default.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/Kendo/kendo.bootstrap.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/Kendo/kendo.dataviz.bootstrap.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/Kendo/kendo.dataviz.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/Kendo/kendo.default.mobile.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/Site.css", new CssRewriteUrlTransformWrapper())

.Include("~/Content/Folder/bootstrap.css", new CssRewriteUrlTransformWrapper())

.Include("~/Content/Folder/main.min.css", new CssRewriteUrlTransformWrapper())
.Include("~/Content/themes/fonts.css", new CssRewriteUrlTransformWrapper());
cssCustom.Orderer = new AsIsBundleOrderer();
cssCustom.Transforms.Add(new CssMinify());
bundles.Add(cssCustom);

BundleTable.EnableOptimizations = true;


public class CssRewriteUrlTransformWrapper : IItemTransform
{
public string Process(string includedVirtualPath, string input)
{
return new CssRewriteUrlTransform().Process("~" + VirtualPathUtility.ToAbsolute(includedVirtualPath), input);
}
}

bootstrap.css 包含在 bundle 中时不起作用。

感谢您的帮助。

最佳答案

Bootstrap.css 文件中有错误,缺少大括号。

成功了。

关于CSS 打包后搞砸了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43789630/

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