简体   繁体   中英

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

I wanna hide that i use The Blazor.

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

How to do this?

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:

在此处输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM