Skip to content

Commit

Permalink
fix: prefetch should not have as attribute (#5683)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux authored and yyx990803 committed May 16, 2017
1 parent 34bc14e commit ebca266
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/template-renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default class TemplateRenderer {
}
return this.prefetchFiles.map(file => {
if (!alreadyRendered(file)) {
return `<link rel="prefetch" href="${this.publicPath}/${file}" as="script">`
return `<link rel="prefetch" href="${this.publicPath}/${file}">`
} else {
return ''
}
Expand Down
2 changes: 1 addition & 1 deletion test/ssr/ssr-template.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe('SSR: template option', () => {
(options.preloadOtherAssets ? `<link rel="preload" href="/test.png" as="image">` : ``) +
(options.preloadOtherAssets ? `<link rel="preload" href="/test.woff2" as="font" type="font/woff2" crossorigin>` : ``) +
// unused chunks should have prefetch
`<link rel="prefetch" href="/1.js" as="script">` +
`<link rel="prefetch" href="/1.js">` +
// css assets should be loaded
`<link rel="stylesheet" href="/test.css">` +
`</head><body>` +
Expand Down

0 comments on commit ebca266

Please sign in to comment.