fix(vue-renderer): base tag should be before any link or script tag (#7376)

This commit is contained in:
Pim 2020-05-16 18:03:24 +02:00 committed by GitHub
parent 925abf8123
commit 224c3794ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,9 +116,16 @@ export default class SSRRenderer extends BaseRenderer {
// (this is unset when features.meta is false in server template)
const meta = renderContext.meta && renderContext.meta.inject()
if (meta) {
HEAD += meta.title.text() +
meta.meta.text() +
meta.link.text() +
HEAD += meta.title.text() + meta.meta.text()
}
// Add <base href=""> meta if router base specified
if (this.options._routerBaseSpecified) {
HEAD += `<base href="${this.options.router.base}">`
}
if (meta) {
HEAD += meta.link.text() +
meta.style.text() +
meta.script.text() +
meta.noscript.text()
@ -127,11 +134,6 @@ export default class SSRRenderer extends BaseRenderer {
// Check if we need to inject scripts and state
const shouldInjectScripts = this.options.render.injectScripts !== false
// Add <base href=""> meta if router base specified
if (this.options._routerBaseSpecified) {
HEAD += `<base href="${this.options.router.base}">`
}
// Inject resource hints
if (this.options.render.resourceHints && shouldInjectScripts) {
HEAD += this.renderResourceHints(renderContext)