Loadable-components: Set different attributes on tags based on chunk

Created on 11 Mar 2019  路  3Comments  路  Source: gregberge/loadable-components

馃殌 Feature Proposal

allow getScriptTags and similar to take a function as an argument which allows for setting different attributes to different chunks/scripts

Motivation

currently there is now way to set different attributes values based on the chunk, which is needed to utilize Subresource Integrity.

Example

const tags = getScriptTags( chunk => {
  if (chunk.id === 'foo') return { integrity: 'SHA-foo' }
} );

Pitch

Subresource Integrity is a very useful feature. I imagine other uses for this feature will be requested.

feature request 馃檹 good first issue 馃 help wanted 馃啒

All 3 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gregberge picture gregberge  路  7Comments

zaccolley picture zaccolley  路  6Comments

ghost picture ghost  路  4Comments

valorloff picture valorloff  路  3Comments

hemmxwxsoo picture hemmxwxsoo  路  4Comments