Closed rwasef1830 closed 4 years ago
I was able to make it work:
Editing csproj:
<ItemGroup>
<Watch Include="**\*.scss" />
</ItemGroup>
Then run from the console in the project folder:
dotnet watch tool run webcompiler -c webcompilerconfiguration.json -r wwwroot
Perhaps documentation should cite such example.
Hi @rwasef1830,
this is a valuable thing to add to the documentation. Thanks a lot for working out how to do it.
BR Stefan
Is it possible to have the same behavior as in mad christensen's version ? Ie: compiles on save without having to use a dotnet watch command line in another window.
Maybe by implementing an additional "nuget local tool" that you add to the project, like analyzers do. From mad christensen's version:
A NuGet package will be installed into the packages folder without adding any files to the project itself. The NuGet package contains an MSBuild task that will run the exact same compilers on the compilerconfig.json file in the root of the project.
Also are you on discord's dotnetevolution ?
Hi @softlion,
There's no plan to implement such a version, as it's significant effort for not much benefit. Have a look at https://github.com/excubo-ag/WebCompiler#msbuild. This shows you how to effectively get the same behavior.
Hope this helps Stefan
I think I have a problem in enabling the watch or the command tool definition.
I get this error:
Could not find a MSBuild project file in 'D:\HIH'. Specify which project to use with the --project option.
I tried the given syntax as well as the below code: (tried both)
dotnet watch tool run webcompiler -c webcompilerconfiguration.json -r wwwroot --project HIH\HIH.csproj
Did I miss anything?
@stefanloerwald @rwasef1830
I always run it from the project folder, never tried --project switch before.
This is an issue with how dotnet tool works and unrelated to webcompiler.
@stefanloerwald fine, I fixed that, By the way, what about this issue:
Earlier I enabled webcompiler globally, and had no issues. Should I create the tool manifest for any project, in its project directory?
Sorry but again, this is an issue with how dotnet tool works and I can't offer any help on that. It's not in scope for this project.
Hello, Is there a way to run automatically on scss file save or have it watch file changes ?