mwrock / RequestReduce

Instantly makes your .net website faster by reducing the number and size of requests with almost no effort.
www.requestreduce.org
Apache License 2.0
228 stars 48 forks source link

LESS Imports not working with RequestReduce (work with dotLess directly) #206

Open Meligy opened 12 years ago

Meligy commented 12 years ago
  1. Create new empty ASP.NET MVC solution
  2. Get RequestReduce.SassLessCoffee 1.8.73 from NuGet
  3. Under "Content" create variables.less file with following in it:
    @main-color: blue;
  1. Under "Content" create site.less file with following in it:
    @import "variables.less";

    body {
        color: @main-color;
    }
  1. Include the following in Views\Shared_Layout.cshtml
    <link rel="Stylesheet" type="text/css" href="@Url.Content("~/content/site.less")" />
  1. Add Home controller with Index action that only shows view, and create Home/Index.cshtml view with following markup:
    @{
        ViewBag.Title = "Index";
    }
    <h2>I should be seen in blue.</h2>
  1. Run the solution, see the header showing in blue as expected. Note that the first time (when RequestReduce has not run the combination/minifcation yet and source code shows the .less file, which is handled by dotLess HTTP handler)
  2. Refresh the page, note the source code showing RequestReduce URL for CSS, but the header showing in black instead of blue.

So, it seems dotLess handles the LESS import right, but when RequestReduce processes the LESS files, it breaks this somehow.

cmjacques commented 12 years ago

I followed your steps exactly and I can't duplicate the problem. The generated CSS contains body{color:blue}. I made no changes to the RR or dotLess configuration.

I tried both the VS dev server and IIS - both worked fine for me.

The only difference i can think of is that I got v1.8.76 from Nuget - however, I've been using RR with dotLess for ages with no problems.

Meligy commented 12 years ago

I tried it again with NuGet package RequestReduce.SassLessCoffee 1.8.76. Same results.

Note that:

The first time you open the page it'll look it works, which I explained in step 7. This is the default dotLESS handler, which works well.

Are you sure you followed step 8? When you refresh the page again you'll find it not working, which is when LESS does combination and generates its own URL.