Permalink
Browse files

fix(manifest): run only on build

  • Loading branch information...
pi0 committed Nov 16, 2017
1 parent b0af84e commit ecaa8355f76d9bd9ea12392b557254b743548600
Showing with 8 additions and 0 deletions.
  1. +8 −0 packages/manifest/index.js
@@ -1,10 +1,18 @@
const hash = require('hash-sum')
const debug = require('debug')('nuxt:pwa:manifest')
const fixUrl = url => url.replace(/\/\//g, '/').replace(':/', '://')
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) {
this.nuxt.plugin('build', builder => {
debug('Adding manifest')
addManifest.call(this, options)
})
}
function addManifest (options) {
// routerBase and publicPath
const routerBase = this.options.router.base
let publicPath = fixUrl(`${routerBase}/${this.options.build.publicPath}`)

0 comments on commit ecaa835

Please sign in to comment.