File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " nextjs-workbox-config " : major
3+ ---
4+
5+ Change config option "disable" to "enable". It just makes more logic to me.
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export function withWorkbox(
1818 dest ?: string
1919 dontCacheBustURLsMatching ?: false
2020 exclude ?: string [ ]
21- disable ?: boolean
21+ enable ?: boolean
2222 modifyURLPrefix ?: Record < string , string >
2323 swDest ?: string
2424 swSrc ?: string
@@ -35,12 +35,10 @@ export function withWorkbox(
3535 const wbConfig = {
3636 additionalManifestEntries : [ ] ,
3737 dest : 'public' ,
38- dontCacheBustURLsMatching : false ,
3938 exclude : [ ] ,
40- disable : false ,
39+ enable : true ,
4140 modifyURLPrefix : { } ,
4241 swDest : 'sw.js' ,
43- swSrc : false ,
4442 ...( options . config . workbox || { } )
4543 }
4644
@@ -51,7 +49,7 @@ export function withWorkbox(
5149 throw new Error ( 'Workbox: service worker "path" is missing' )
5250 }
5351
54- if ( wbConfig . disable ) {
52+ if ( ! wbConfig . enable ) {
5553 console . log ( 'Workbox: service worker is disabled' )
5654
5755 return config
You can’t perform that action at this time.
0 commit comments