I have multiple CSS's files in our project and we are bundling these files.
One of the file when included in Bundling does not work as expected but taking away from bundling, it is working.
Here is the code
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 when included in bundle does not work.
Thanks for help.
There were errors in Bootstrap.css file, there were missing curly braces.
That did the trick.