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) {