Skip to content

Break build on SASS compilation errors #213

@peterwurzinger

Description

@peterwurzinger

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! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions