diff --git a/lib/amp/plugin.js b/lib/amp/plugin.js index 43fcbf9f..63990267 100644 --- a/lib/amp/plugin.js +++ b/lib/amp/plugin.js @@ -94,8 +94,10 @@ const createCustomHead = originalHead => function customHead () { */ ensureKey(head, 'link', []) - // Add canonical meta only if page is served as AMP - if (this.$ampMode !== false && this.$isAMP === true) { + /** + * Add canonical meta and AMP requirement if page is served as AMP + */ + if (this.$isAMP) { if (origin && !head.link.find(l => l.rel === 'canonical' || l.hid === 'canonical')) { const path = this.$isAMP && this.$ampMode !== 'only' ? this.$route.fullPath.replace(/^\/amp(\/.*)?/, '$1') @@ -107,12 +109,7 @@ const createCustomHead = originalHead => function customHead () { href: origin + path }) } - } - /** - * add amp requirement if page is served as AMP - */ - if (this.$isAMP) { ensureKey(head, 'htmlAttrs', {}) if (vueMetaMajor >= 2) {