-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
I'm using .NET 6.0.100-preview.5.21302.13 and Blazor Server.
I am trying to integrate a CSS framework (tailwind/postcss) with hot reload. My approach is to extend my project file with custom targets to trigger the CSS pre-compile. For scoped CSS this actually works great: I inspect and process the generated scoped files after the target "_GenerateScopedCssFiles" is completed.
When a .razor file is edited though, I cannot seem to find an msbuild target that I can attach my custom logic to as before/after target. I grepped through a verbose log created from "dotnet build" to identify something suitable but no success.
What exactly happens during hot reload when a .razor file changes? Is there some msbuild targets involved at all? The verbose output of "dotnet watch" does not give any clues.
My workaround currently is to run a separate watcher (here: tailwind CLI) for these files, and let "dotnet watch" then process the resulting static CSS.