File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const path = require('path')
2
2
const { writeFileSync, readFileSync } = require ( 'fs' )
3
3
const hashSum = require ( 'hash-sum' )
4
4
const debug = require ( 'debug' ) ( 'nuxt:pwa' )
5
+ const { defaultsDeep } = require ( 'lodash' )
5
6
6
7
const fixUrl = url => url . replace ( / \/ \/ / g, '/' ) . replace ( ':/' , '://' )
7
8
const isUrl = url => url . indexOf ( 'http' ) === 0 || url . indexOf ( '//' ) === 0
@@ -55,7 +56,7 @@ function addOneSignal (moduleOptions) {
55
56
}
56
57
}
57
58
58
- const options = Object . assign ( defaults , moduleOptions , this . options . oneSignal )
59
+ const options = defaultsDeep ( { } , this . options . oneSignal , moduleOptions , defaults )
59
60
60
61
if ( options . OneSignalSDK === undefined ) {
61
62
if ( options . cdn ) {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const { readFileSync, writeFileSync } = require('fs')
4
4
const hashSum = require ( 'hash-sum' )
5
5
const escapeStringRegexp = require ( 'escape-string-regexp' )
6
6
const debug = require ( 'debug' ) ( 'nuxt:pwa' )
7
+ const { defaultsDeep } = require ( 'lodash' )
7
8
8
9
const fixUrl = url => url . replace ( / \/ \/ / g, '/' ) . replace ( ':/' , '://' )
9
10
const isUrl = url => url . indexOf ( 'http' ) === 0 || url . indexOf ( '//' ) === 0
@@ -43,7 +44,7 @@ function getOptions (moduleOptions) {
43
44
}
44
45
}
45
46
46
- const options = Object . assign ( {
47
+ const defaults = {
47
48
autoRegister : true ,
48
49
routerBase,
49
50
publicPath,
@@ -70,7 +71,9 @@ function getOptions (moduleOptions) {
70
71
handler : 'networkFirst'
71
72
}
72
73
]
73
- } , moduleOptions , this . options . workbox )
74
+ }
75
+
76
+ const options = defaultsDeep ( { } , this . options . workbox , moduleOptions , defaults )
74
77
75
78
return options
76
79
}
You can’t perform that action at this time.
0 commit comments