Skip to content

Conversation

@jsip
Copy link

@jsip jsip commented Dec 5, 2023

Enables useStrictCSP when injecting styles. See https://github.com/marco-prontera/vite-plugin-css-injected-by-js#usestrictcsp-boolean

Does not throw any errors if meta property is not present

useStrictCSP ? `elementStyle.nonce = document.head.querySelector('meta[property=csp-nonce]')?.content;` : ''

Updated README to reflect the out of the box support

@jsip jsip force-pushed the viteCssPlugin-UseStrictCSP branch 2 times, most recently from 234e18e to 2c86215 Compare December 5, 2023 21:09
@jsip jsip force-pushed the viteCssPlugin-UseStrictCSP branch from 2c86215 to 6943825 Compare December 5, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant