allow getScriptTags and similar to take a function as an argument which allows for setting different attributes to different chunks/scripts
currently there is now way to set different attributes values based on the chunk, which is needed to utilize Subresource Integrity.
const tags = getScriptTags( chunk => {
if (chunk.id === 'foo') return { integrity: 'SHA-foo' }
} );
Subresource Integrity is a very useful feature. I imagine other uses for this feature will be requested.
Hello @salzhrani, good idea, I am open to the suggestion! Feel free to make a PR to implement it!
Why was this closed? @salzhrani Have you figured out how to implement SRI?
EDIT: Ah I see - #277 implemented this, was just never referenced.
@odensc thanks for referencing it!