In addition to the accepted answer, Blazor in .NET 9 (maybe 8 as well) supports this single line to accomplish the same thing.
builder.WebHost.UseStaticWebAssets()