Permalink
Browse files

fix: workaround to fill meta with SPA and nuxt start

  • Loading branch information...
pi0 committed Nov 17, 2017
1 parent 36736bd commit a0fb9084462d5f212009ec80cf0c64142ff59126
Showing with 15 additions and 3 deletions.
  1. +5 −1 packages/icon/index.js
  2. +5 −1 packages/manifest/index.js
  3. +5 −1 packages/meta/index.js
@@ -7,11 +7,15 @@ const fixUrl = url => url.replace(/\/\//g, '/').replace(':/', '://')
const isUrl = url => url.indexOf('http') === 0 || url.indexOf('//') === 0
module.exports = function nuxtIcon (options) {
const hook = builder => {
const hook = () => {
debug('Adding icons')
return generateIcons.call(this, options)
}
if (this.options.mode === 'spa') {
return hook()
}
this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook)
}
@@ -6,11 +6,15 @@ const isUrl = url => url.indexOf('http') === 0 || url.indexOf('//') === 0
const find = (arr, key, val) => arr.find(obj => val ? obj[key] === val : obj[key])
module.exports = function nuxtManifest (options) {
const hook = builder => {
const hook = () => {
debug('Adding manifest')
addManifest.call(this, options)
}
if (this.options.mode === 'spa') {
return hook()
}
this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook)
}
@@ -3,11 +3,15 @@ const debug = require('debug')('nuxt:pwa')
const find = (arr, key, val) => arr.find(obj => val ? obj[key] === val : obj[key])
module.exports = function nuxtMeta (_options) {
const hook = builder => {
const hook = () => {
debug('Adding meta')
generateMeta.call(this, _options)
}
if (this.options.mode === 'spa') {
return hook()
}
this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook)
}

0 comments on commit a0fb908

Please sign in to comment.