How to remove unused style files/fonts from build Blazor WASM?


I'm using Radzen in the Blazor WebAssembly project. After a publish build, the wwwroot/_content/Radzen.Blazor folder contains unused (by me) CSS files and fonts.

My index.html file only references a default-base style.

<!DOCTYPE html>
<html lang="en">

    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <base href="/"/>
    <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet"/>
    <link href="css/app.css" rel="stylesheet"/>
    <link href="FastVlangVisualization.styles.css" rel="stylesheet"/>
    <link rel="stylesheet" href="_content/Radzen.Blazor/css/default-base.css">

<article class="content px-4">
    <div id="app">

    <div id="blazor-error-ui">
        An unhandled error has occurred.
        <a href="" class="reload">Reload</a>
        <a class="dismiss">🗙</a>

<script src="_framework/blazor.webassembly.js"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>


Is there any built-in way to remove unused stuff?

As far as we know there isn't - the publish command copies all resources embedded in the assembly. Those unused files however will not be downloaded by your clients so they should introduce extra traffic or delay. You can safely delete them.