From 8e54bbd74d86537b449641a6623b1bc3800e82b2 Mon Sep 17 00:00:00 2001 From: Adam Hines Date: Thu, 18 Apr 2024 04:54:39 -0600 Subject: [PATCH] feat: write cspNonce to style tags (#16419) --- docs/guide/features.md | 2 +- packages/vite/src/node/plugins/html.ts | 1 + playground/csp/index.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/guide/features.md b/docs/guide/features.md index 4d7d674f413743..75940b8d17310c 100644 --- a/docs/guide/features.md +++ b/docs/guide/features.md @@ -699,7 +699,7 @@ To deploy CSP, certain directives or configs must be set due to Vite's internals ### [`'nonce-{RANDOM}'`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#nonce-base64-value) -When [`html.cspNonce`](/config/shared-options#html-cspnonce) is set, Vite adds a nonce attribute with the specified value to the output script tag and link tag for stylesheets. Note that Vite will not add a nonce attribute to other tags, such as `