![](/img/trans.png)
[英]Where do I put the blazor.server.js script tag in a RazorPages app?
[英]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.