Permalink
Browse files

fix(workbox): update modifyUrlPrefix for latest workbox (#75)

  • Loading branch information...
pi0 committed Jul 19, 2017
1 parent 985f892 commit 93e3b669529bb397c3c98fa1eabf4f3a00b7cbfb
Showing with 3 additions and 3 deletions.
  1. +3 −3 modules/workbox/index.js
@@ -1,5 +1,5 @@
const path = require('path')
const workboxPlugin = require('workbox-webpack-plugin');
const workboxPlugin = require('workbox-webpack-plugin')
const fixUrl = url => url.replace(/\/\//g, '/').replace(':/', '://')
const wildcardRegex = url => '/' + fixUrl(url + '/.*').replace(/\//g, '\\/') + '/'
@@ -28,12 +28,12 @@ module.exports = function nuxtWorkbox (options) {
this.options.build.plugins.push(new workboxPlugin(Object.assign({
swDest: path.resolve(this.options.srcDir, 'static', swFileName),
//navigateFallback: routerBase, // it has some BUGS
// navigateFallback: routerBase, // it has some BUGS
directoryIndex: '/',
cacheId: process.env.npm_package_name + '_' + process.env.npm_package_version,
globPatterns: ['**\/*.{js,css,html,json}'],
modifyUrlPrefix: {
'/': fixUrl(publicPath)
'': fixUrl(publicPath)
},
runtimeCaching: [
// Cache other _nuxt resources runtime

0 comments on commit 93e3b66

Please sign in to comment.