Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't my css getting minified?

I'm not clear what I'm missing here. As far as I can tell I've followed the instruction here. But my css bundle is still not getting minified.

Here's my RegisterBundles code:

public static void RegisterBundles(BundleCollection bundles)
{
    bundles.UseCdn = true;
    BundleTable.EnableOptimizations = true;

    bundles.Add(new ScriptBundle("~/bundles/otherjquery").Include(
            "~/App_Themes/Travel2/Script/jquery-ui.min.js",
            "~/Scripts/jquery.validate.unobtrusive.js",
            "~/Scripts/jquery.unobtrusive-ajax.js"));

   Bundle availabiltyResult = new StyleBundle("~/bundles/css/availabiltyResult").Include(
                "~/CSS/Travel2/Air.css",
                "~/CSS/Travel2/Air/AvailabiltyResults.css"
                );
    availabiltyResult.Transforms.Add(new CssMinify());
    bundles.Add(availabiltyResult);
}

I've disabled debugging in my web.config by removing the <compilation debug="true">. I can see the js getting bundled and minified:

enter image description here

but the css is getting bundled but not minified:

enter image description here

What am I missing here?

like image 784
Liam Avatar asked Nov 22 '22 02:11

Liam


1 Answers

The problem was that the file was getting minified but that FireBug was re-parsing the code so it looked like it wasn't. Looking at it using Fiddler I can see that the css is (in fact) getting minified:

enter image description here

Kudos to @Kimi for the spotting it.

like image 106
Liam Avatar answered Mar 08 '23 06:03

Liam