Guest User

Untitled

a guest
Dec 15th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. const chunksPrefetch = extractor.chunks.concat(extractor.entrypoints)
  2. const assetsPrefetch = extractor.getChunkChildAssets(chunksPrefetch, 'prefetch')
  3.  
  4. const linksPrefetch = assetsPrefetch.map(({chunk, linkType, scriptType, url, type}) => (
  5. `<link ${type === 'mainAsset' ? 'data-chunk' : 'data-parent-chunk'}="${chunk}" rel="${linkType}" as="${scriptType}" href="${url}">`
  6. ))
Add Comment
Please, Sign In to add comment