Relative Content

Tag Archive for reactjslaravelwebpacklaravel-mixwebpack-style-loader

Why is my Webpack nonce only applied to the first style tag and not all styles in the document?

I’m working with both a basic Webpack setup and a Laravel Mix project that includes React. I’m trying to apply a nonce attribute to all tags to comply with my Content Security Policy (CSP), but I’m encountering an issue where the nonce is only applied to the first tag generated by Webpack and not the subsequent ones.
I first attempted this with my Laravel Mix project, but after failing there, I set up a simple Webpack project to isolate the issue. While I managed to apply the nonce to one style tag in the basic Webpack setup, the rest of the styles generated do not receive the nonce, and multiple tags appear in the without the nonce.