We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fbb86b commit c25a017Copy full SHA for c25a017
1 file changed
server/Pages/_Host.cshtml
@@ -29,12 +29,8 @@
29
if (hostEnvironment.IsDevelopment())
30
{
31
// do nothing in development, Angular > 18.1.0 adds the nonce automatically
32
- }
33
- else
34
- {
35
- // Angular release build does not add any nonce to the scripts, so we need to add it manually
36
- var nonceScript = $"<script nonce=\"{nonce}\" ";
37
- source = source.Replace("<script ", nonceScript);
+ var viteScriptToUpdate = """<script type="module" src="/@vite/client"></script>""";
+ source = source.Replace(viteScriptToUpdate, $"""<script type="module" src="/@vite/client" nonce="{nonce}"></script>""");
38
}
39
40
// link rel="stylesheet"
0 commit comments