AspNetCore.SassCompiler icon indicating copy to clipboard operation
AspNetCore.SassCompiler copied to clipboard

Break build on SASS compilation errors

Open peterwurzinger opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. I guess it's not really a problem, rather than a QOL thing.

Describe the solution you'd like If the SASS compilation fails, the MSBuild Task should also fail. E.g. I edited my main.scss to import a file that doesn't exist, I can see the output

AspNetCore.SassCompiler.targets(16,5): error : Error: Can't find stylesheet to import.
AspNetCore.SassCompiler.targets(16,5): error :   ╷
AspNetCore.SassCompiler.targets(16,5): error : 8 │ @import "whatever";
AspNetCore.SassCompiler.targets(16,5): error :   │         ^^^^^^^^^^

and the main.css then contains the error as

-content.

It would be great being able to express something like

<PropertyGroup>
  <!-- Emit a build error if the SASS compiler is sad -->
  <SassCompilerErrorSeverity>Error</SassErrorSeverity>

  <!-- Or go even further -->
  <SassCompilerTreatWarningsAsErrors>true<SassTreatWarningsAsErrors>
</PropertyGroup>

Describe alternatives you've considered Couldn't really think of any.

Additional context Thanks for your work guys! :)

peterwurzinger avatar Dec 12 '24 10:12 peterwurzinger