I got the old Would you like to normalize line endings on my .less file and without thinking did so.
I realized later that my css wasnt completely minified. Here's the process method for the transform
public void Process(BundleContext context, BundleResponse response)
{
response.Content = dotless.Core.Less.Parse(response.Content);
response.ContentType = "text/css";
}
BundleConfig.cs
bundles.Add(new Bundle("~/Less/css", new LessTransform(), new CssMinify())
.Include("~/Content/css/App.less"));
I put a break point in Process
and copied the before/after CSS and found that dotless
was only removing /r
and not /n
Here's a snippet of my css file showing the behavior
Before dotless Parse
"/*\r\n\r\nApp.less\r\n
After dotless Parse
"/*\n\nApp.less\n
So it's technically working, just not optimally. I was thinking about going back and removing the /r/n
from the file and replacing them with just /r
but would love a solution that doesn't cause the line endings dialog to pester me whenever I open the file.
UPDATE: Forgot that I upgraded the dotless nuget package recently as well
My Webconfig
<configSections>
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
...
</configSections>
...
<httpHandlers>
<add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" />
</httpHandlers>
...
<handlers>
<add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
</handlers>
...
<dotless minifyCss="true" />