繁体   English   中英

如何在 Z4681ZF7FA AppC81259CEF8E959C624DF1D456E5D3297Z 文件(ProjectName.style.css 和 blazor.server.js)中重命名捆绑的 static 文件(ProjectName.style.css 和 blazor.server.js)

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

我想隐藏我使用的是 Blazor。

所以,我应该修改捆绑的 css 和 js 文件的名称。

这个怎么做?

根据这篇文章,CSS 隔离发生在构建时。 在此过程中,Blazor 重写 CSS 选择器以匹配组件呈现的标记。 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.

这意味着我们只能在开发环境中禁用捆绑包而不能修改它。

但是发布后,它会生成这样的文件:

在此处输入图像描述

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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