We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0af84e commit ecaa835Copy full SHA for ecaa835
packages/manifest/index.js
@@ -1,10 +1,18 @@
1
const hash = require('hash-sum')
2
+const debug = require('debug')('nuxt:pwa:manifest')
3
4
const fixUrl = url => url.replace(/\/\//g, '/').replace(':/', '://')
5
const isUrl = url => url.indexOf('http') === 0 || url.indexOf('//') === 0
6
const find = (arr, key, val) => arr.find(obj => val ? obj[key] === val : obj[key])
7
8
module.exports = function nuxtManifest (options) {
9
+ this.nuxt.plugin('build', builder => {
10
+ debug('Adding manifest')
11
+ addManifest.call(this, options)
12
+ })
13
+}
14
+
15
+function addManifest (options) {
16
// routerBase and publicPath
17
const routerBase = this.options.router.base
18
let publicPath = fixUrl(`${routerBase}/${this.options.build.publicPath}`)
0 commit comments