BundleTransformer.Less does not process inactive files if the variables are out of order

In the process of updating my nuget packages for BundleTransformer.Less from 1.9.20 to 1.9.143, my application styles no longer display correctly.

I tracked the problem so as not to compile the file, since the order of declaration and use of the variable. My understanding says less that you can define a variable after using it, but that is no longer the case. I can reproduce something as simple as

html {
    color : @test;
}

@test:green;

What works in online less sandboxes for me.

My application builds and maintains the .less file when requested without errors, but the contents of the file are simply

variable @test is undefined on line 17 in file '/icons.less':
 [16]: html{
 [17]:     color : @test;
       ------------^
 [18]: }

What part of the compilation will suddenly satisfy the demand for variable orders?

+4

Source: https://habr.com/ru/post/1677030/


All Articles