Skip to content

Commit

Permalink
fix(bundler-webpack): avoid duplicated style preload
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Dec 10, 2022
1 parent 21e1f91 commit e484a55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Expand Up @@ -32,7 +32,7 @@ export const renderPagePrefetchLinks = ({
if (shouldPrefetch !== true && !shouldPrefetch(file, type)) {
return ''
}
return `<link rel="prefetch" href="${app.options.base}${file}" as="${type}" />`
return `<link rel="prefetch" href="${app.options.base}${file}" as="${type}">`
})
.join('')
}
7 changes: 3 additions & 4 deletions packages/bundler-webpack/src/build/renderPageStyles.ts
Expand Up @@ -17,8 +17,7 @@ export const renderPageStyles = ({
// notice here we put async CSS files after initial CSS files
[...initialFilesMeta, ...pageClientFilesMeta]
.filter(({ type }) => type === 'style')
.flatMap(({ file }) => [
`<link rel="preload" href="${app.options.base}${file}" as="style" />`,
`<link rel="stylesheet" href="${app.options.base}${file}" />`,
])
.map(
({ file }) => `<link rel="stylesheet" href="${app.options.base}${file}">`
)
.join('')

0 comments on commit e484a55

Please sign in to comment.