File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,24 @@ module.exports = function nuxtWorkbox (moduleOptions) {
17
17
return
18
18
}
19
19
20
+ let options
21
+
20
22
const hook = builder => {
21
23
debug ( 'Adding workbox' )
22
- const options = getOptions . call ( this , moduleOptions )
24
+ options = getOptions . call ( this , moduleOptions )
23
25
workboxInject . call ( this , options )
24
26
setHeaders . call ( this , options )
25
27
emitAssets . call ( this , options )
26
28
addTemplates . call ( this , options )
27
29
}
28
30
31
+ // Get client output path (#83)
32
+ this . extendBuild ( ( config , { isClient } ) => {
33
+ if ( isClient && ! options . globDirectory ) {
34
+ options . globDirectory = config . output . path
35
+ }
36
+ } )
37
+
29
38
this . nuxt . hook ? this . nuxt . hook ( 'build:before' , hook ) : this . nuxt . plugin ( 'build' , hook )
30
39
}
31
40
@@ -67,7 +76,7 @@ function getOptions (moduleOptions) {
67
76
clientsClaim : true ,
68
77
skipWaiting : true ,
69
78
globPatterns : [ '**/*.{js,css}' ] ,
70
- globDirectory : path . resolve ( this . options . buildDir , 'dist' ) ,
79
+ globDirectory : undefined ,
71
80
modifyUrlPrefix : {
72
81
'' : fixUrl ( publicPath )
73
82
} ,
You can’t perform that action at this time.
0 commit comments