diff --git a/lib/core/meta.old.js b/lib/core/meta.old.js deleted file mode 100644 index 75f8b78a86..0000000000 --- a/lib/core/meta.old.js +++ /dev/null @@ -1,74 +0,0 @@ - -import { attrsStr } from 'utils' -import LRU from 'lru-cache' - -export default class MetaRenderer { - constructor (nuxt, renderer) { - this.nuxt = nuxt - this.renderer = renderer - this.options = nuxt.options - this.cache = LRU({}) - } - - render ({ url = '/' }) { - let head = this.cache.get(url) - - if (head) { - return head - } - - head = '' - - // Title - if (typeof this.options.head.title === 'string') { - head += `${this.options.head.title || ''}` - } - - // Meta - if (Array.isArray(this.options.head.meta)) { - this.options.head.meta.forEach(meta => { - head += `` - }) - } - - // Links - if (Array.isArray(this.options.head.link)) { - this.options.head.link.forEach(link => { - head += `` - }) - } - - // Style - if (Array.isArray(this.options.head.style)) { - this.options.head.style.forEach(style => { - head += `` - }) - } - - // Script - if (Array.isArray(this.options.head.script)) { - this.options.head.script.forEach(script => { - head += `` - }) - } - - // Resource Hints - const clientManifest = this.renderer.resources.clientManifest - if (this.options.render.resourceHints && clientManifest) { - const publicPath = clientManifest.publicPath || '/_nuxt/' - // Pre-Load initial resources - if (Array.isArray(clientManifest.initial)) { - head += clientManifest.initial.map(r => ``).join('') - } - - // Pre-Fetch async resources - if (Array.isArray(clientManifest.async)) { - head += clientManifest.async.map(r => ``).join('') - } - } - - this.cache.set(url, head) - - return head - } -}