Skip to content

Commit a5d6c2b

Browse files
committed
fix(@angular/build): add CSP nonce attribute to script tags when inline critical CSS is disabled
Prior to this change when inline critical CSS is disabled CSP `nonce` was not added to script tags. Closes #28102
1 parent bd1e0d8 commit a5d6c2b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/angular/build/src/utils/index-file/index-html-generator.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export class IndexHtmlGenerator {
7878
this.csrPlugins.push(inlineCriticalCssPlugin(this));
7979
}
8080

81+
this.csrPlugins.push(addNoncePlugin());
82+
8183
// SSR plugins
8284
if (options.generateDedicatedSSRContent) {
8385
this.ssrPlugins.push(addEventDispatchContractPlugin(), addNoncePlugin());

0 commit comments

Comments
 (0)