Closed JelleHissink closed 3 years ago
Something's not working properly, or my understanding could be wrong...
Below my test findings with dotnet watch build
.scss
files aren't watched by default, I still had to explicitly add <Watch Include="**\*.scss" Exclude="**\*.css" />
After assigning the watch and logging (<LibSassOutputLevel>verbose</LibSassOutputLevel>
) - then editing one of the .scss
files, it seems to process all the .scss
files:
watch : Waiting for a file to change before restarting dotnet...
watch : Started
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
Sass compile files
Processing: C:\SourceCode\LibSassBuilderNugetTester\LibSassBuilderNugetTester\Pages\Counter.razor.scss
Processing: C:\SourceCode\LibSassBuilderNugetTester\LibSassBuilderNugetTester\Shared\MainLayout.razor.scss
Processing: C:\SourceCode\LibSassBuilderNugetTester\LibSassBuilderNugetTester\wwwroot\foo.scss
Sass files compiled
My understanding was that MSBuild would now only send changed files to LSB
If you specify a LibSassBuilderArgs SassFiles are ignored (https://github.com/johan-v-r/LibSassBuilder/pull/12/files#diff-540629219a4a03215aa6df95d26b5d60f458b7f9e4737b3bfa5c826716965046R18 LibSassBuilder.targets line 18).
Because SassFile items are not used at all when you specify args. Would you still want
It does not only send changed files, I did not know what files are included, referenced or used by what other files. But it would be a nice future addition. But then we would need a list of dependencies or rules (e.g. files starting with _ => trigger all?) Also for now there is not a hash per file, but one hash over the filelisting/modification date.
In short for now: scss changes are detected the tool is run, otherwise not.
Nope that test was without specifying LibSassBuilderArgs
- using just the default config with a local build from your branch, see my .csproj
:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LibSassBuilder" Version="1.5.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.0" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
</ItemGroup>
<PropertyGroup>
<LibSassOutputLevel>verbose</LibSassOutputLevel>
</PropertyGroup>
</Project>
So what's the difference/benefit of having MSBuild traversing the directory to find the files, vs letting LSB do that by default..?
I'll look into it, did not test after latest refactoring
For me dotnet watch now works again, had to move the property to the .props file for it to work? Strange... but ok I guess
Retry of PR: 8
Now based on the new files option