From 38485af547401c2336be97082bac1dd8d514744c Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 9 Sep 2019 13:05:14 +0200 Subject: [PATCH] fix pwa option handling --- lib/workbox/module.js | 4 ++-- lib/workbox/options.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/workbox/module.js b/lib/workbox/module.js index c614ad68..2fc2a132 100755 --- a/lib/workbox/module.js +++ b/lib/workbox/module.js @@ -3,10 +3,10 @@ const path = require('path') const { getOptions } = require('./options') const { readJSFiles } = require('./utils') -module.exports = function nuxtWorkbox (workboxOptions) { +module.exports = function nuxtWorkbox (pwa) { this.nuxt.hook('build:before', async () => { // Get options - const options = getOptions.call(this, workboxOptions) + const options = getOptions.call(this, pwa) // Warning for dev option if (options.dev) { diff --git a/lib/workbox/options.js b/lib/workbox/options.js index d2918c4c..95267282 100644 --- a/lib/workbox/options.js +++ b/lib/workbox/options.js @@ -2,8 +2,8 @@ const path = require('path') const defaults = require('./defaults') const { joinUrl, getRouteParams, startCase } = require('../utils') -function getOptions (workboxOptions) { - const options = { ...defaults, ...workboxOptions } +function getOptions (pwa) { + const options = { ...defaults, ...pwa.workbox } // routerBase if (!options.routerBase) {