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

Hi,

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">

<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>FastVlangVisualization</title>
    <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">
</head>

<body>
<article class="content px-4">
    <div id="app">
        <p>
            <em>Loading...</em>
        </p>
    </div>

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

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

</html>

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.