Warm tip: This article is reproduced from serverfault.com, please click

How to rename bundled static files(ProjectName.style.css and blazor.server.js) in The Blazor App

发布于 2021-01-05 05:06:14

I wanna hide that i use The Blazor.

so, I should modify name of bundled css and js files.

How to do this?

Questioner
Jang-Ho Bae
Viewed
0
Brando Zhang 2021-01-05 19:22:02

According to this article, CSS isolation occurs at build time. During this process, Blazor rewrites CSS selectors to match markup rendered by the component. These rewritten CSS styles are bundled and produced as a static asset at {PROJECT NAME}.styles.css, where the placeholder {PROJECT NAME} is the referenced package or product name.

That means we could only disable the bundle not modify it during develop environment.

But after publish, it will generate the file like this:

enter image description here

You could modify the {PROJECT NAME}.styles.css to {other}.styles.css and modify the index.html css name as below:

<link href="{other}.styles.css" rel="stylesheet" />