Skip to content

Commit

Permalink
fix(html): avoid duplicated modulepreload
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 29, 2019
1 parent c22a0a4 commit d68a478
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/html/inject-module-preloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function optimizeCriticalPath(config: d.Config, doc: Document, criticalBu

export function injectModulePreloads(doc: Document, paths: string[]) {
const existingLinks = (Array.from(doc.querySelectorAll('link[rel=modulepreload]')) as HTMLLinkElement[])
.map(link => link.href);
.map(link => link.getAttribute('href'));

const addLinks = paths
.filter(path => !existingLinks.includes(path))
Expand Down

0 comments on commit d68a478

Please sign in to comment.