Skip to content

Commit

Permalink
fix pwa option handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 9, 2019
1 parent 6c847cc commit 38485af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/workbox/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/workbox/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 38485af

Please sign in to comment.