Change LibSassBuilder output directory

94 Views Asked by At

I'm using LibSassBuilder in a Blazor project. I have read the docs and it's unclear to me if the package's config allows you to specify an output directory. I'd prefer to keep my .scss files outside of wwwroot and just place the compiled .css files there-- but I don't see if there's a way to do this. If not, is there a way to specify a file move to wwwroot in the Visual Studio build pipeline?

1

There are 1 best solutions below

0
Dave Werner On

I'm also developing a Blazor project using LibSassBuilder. This is how I got it to work in my .csproj file:

<PropertyGroup>
    <LibSassOutputStyle>compressed</LibSassOutputStyle>
    <LibSassOutputStyle Condition="'$(Configuration)' == 'Debug'">expanded</LibSassOutputStyle>
</PropertyGroup>

<ItemGroup>
    <CSSFiles Include="**/*.css" />
</ItemGroup>

<Target Name="MoveCSS" AfterTargets="Build">
    <Move SourceFiles="@(CSSFiles)" DestinationFolder="wwwroot/css" />
</Target>