Closed walmik closed 6 years ago
Closing this issue as the following worked for me:
<!-- build:[nonce] {nonce} -->
<!-- build:js inline js/signin-split.js -->
<script nonce="{nonce}" src="{context.links.jsBaseUrl|ha|s}/signin-split.js"></script>
<!-- /build -->
<!-- /build -->
And this one works with an additional task in the Gruntfile,
<!-- build:[nonce] {nonce} -->
<!-- build:js inline -->
<!-- build:[src] js/ -->
<script nonce="{nonce}" src="{context.links.jsBaseUrl|ha|s}/signin-split.js"></script>
<!-- /build -->
<!-- /build -->
<!-- /build -->
Hi there, I ve been using this Grunt plugin for over 3 years now and it works great! This is how my code looks:
Recently i ve needed to add a nonce attribute to the
script
tag. Unfortunately the following doesnt work as expected:The nonce attribute is not retained and the processed HTML only has a
script
tag with the main.js content inside it. Is there some way I can retain the nonce attribute in the processed html?