Skip to content

Commit a0fb908

Browse files
author
Pooya Parsa
committedNov 17, 2017
fix: workaround to fill meta with SPA and nuxt start
1 parent 36736bd commit a0fb908

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed
 

Diff for: ‎packages/icon/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ const fixUrl = url => url.replace(/\/\//g, '/').replace(':/', '://')
77
const isUrl = url => url.indexOf('http') === 0 || url.indexOf('//') === 0
88

99
module.exports = function nuxtIcon (options) {
10-
const hook = builder => {
10+
const hook = () => {
1111
debug('Adding icons')
1212
return generateIcons.call(this, options)
1313
}
1414

15+
if (this.options.mode === 'spa') {
16+
return hook()
17+
}
18+
1519
this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook)
1620
}
1721

Diff for: ‎packages/manifest/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ const isUrl = url => url.indexOf('http') === 0 || url.indexOf('//') === 0
66
const find = (arr, key, val) => arr.find(obj => val ? obj[key] === val : obj[key])
77

88
module.exports = function nuxtManifest (options) {
9-
const hook = builder => {
9+
const hook = () => {
1010
debug('Adding manifest')
1111
addManifest.call(this, options)
1212
}
1313

14+
if (this.options.mode === 'spa') {
15+
return hook()
16+
}
17+
1418
this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook)
1519
}
1620

Diff for: ‎packages/meta/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ const debug = require('debug')('nuxt:pwa')
33
const find = (arr, key, val) => arr.find(obj => val ? obj[key] === val : obj[key])
44

55
module.exports = function nuxtMeta (_options) {
6-
const hook = builder => {
6+
const hook = () => {
77
debug('Adding meta')
88
generateMeta.call(this, _options)
99
}
1010

11+
if (this.options.mode === 'spa') {
12+
return hook()
13+
}
14+
1115
this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook)
1216
}
1317

0 commit comments

Comments
 (0)
Please sign in to comment.