Permalink
Browse files

fix(workbox): incorrect swURL when routerBase is /

  • Loading branch information...
pi0 committed Jun 5, 2017
1 parent ac75991 commit efbd90e73adb0246ddc886b60127cc3e97251a25
Showing with 2 additions and 2 deletions.
  1. +2 −2 modules/workbox/index.js
@@ -6,7 +6,7 @@ const regexEscape = url => url.replace(/\//g, '\\/') // / ~> \/
const wildcardRegex = url => '/' + regexEscape(fixUrl(url + '/.*')) + '/' // [url] ~> /[escape_url]\/*/
const isUrl = url => url.indexOf('http') === 0 || url.indexOf('//') === 0
module.exports = function nuxtWorkbox(options) {
module.exports = function nuxtWorkbox (options) {
if (this.options.dev) {
return
}
@@ -50,7 +50,7 @@ module.exports = function nuxtWorkbox(options) {
src: path.resolve(__dirname, 'plugin.js'),
ssr: false,
options: {
swURL: routerBase + swFileName,
swURL: fixUrl(`${routerBase}/${swFileName}`),
swScope: fixUrl(`${routerBase}/`)
}
})

0 comments on commit efbd90e

Please sign in to comment.