Is there a way to make Blazor Webassembly recompile .razor
files when they're changed/updated and then saved? I'm used to this happening both in traditional ASP.NET Core MVC razor views as well as client-side frameworks like Angular.
In ASP.NET Core MVC >3.0, something like
services.AddRazorPages().AddRazorRuntimeCompilation();
would do the trick, but nothing exists for Blazor that I could find.
It's annoying when I need to stop the entire application and restart it to see the latest changes. By default the Main
method for a new Blazor application looks like
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
await builder.Build().RunAsync();
}
What am I missing here? Is Blazor WASM just not there yet? I'm open to something a little hacky like dotnet watch
dotnet build
if that's a solution.