File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module.exports = {
44 workboxURL : undefined ,
55 importScripts : [ ] ,
66 autoRegister : true ,
7- dev : false ,
7+ dev : undefined ,
88
99 // Config
1010 config : { } ,
@@ -16,7 +16,7 @@ module.exports = {
1616 // Precache
1717 preCaching : [ ] ,
1818 cacheOptions : {
19- cacheId : process . env . npm_package_name || 'nuxt' ,
19+ cacheId : undefined ,
2020 directoryIndex : '/' ,
2121 revision : undefined
2222 } ,
Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ function getOptions (moduleOptions) {
7070 options . preCaching . unshift ( options . offlinePage )
7171 }
7272
73+ // Default cacheId
74+ if ( options . cacheOptions . cacheId === undefined ) {
75+ options . cacheOptions . cacheId = ( process . env . npm_package_name || 'nuxt' ) + ( this . options . dev ? '-dev' : '-prod' )
76+ }
77+
7378 // Normalize runtimeCaching
7479 options . runtimeCaching = options . runtimeCaching . map ( entry => ( {
7580 ...entry ,
@@ -83,7 +88,7 @@ function getOptions (moduleOptions) {
8388 }
8489
8590 // Workbox Config
86- if ( ! options . config . debug ) {
91+ if ( options . config . debug === undefined ) {
8792 // Debug field is by default set to true for localhost domain which is not always ideal
8893 options . config . debug = options . dev || this . options . dev
8994 }
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ workbox.precaching.precacheAndRoute([
9696 \\ "/offline.png\\ ",
9797 \\ "precache.js\\ "
9898], {
99- \\" cacheId\\ " : \\" nuxt\\ " ,
99+ \\" cacheId\\ " : \\" nuxt-prod \\ " ,
100100 \\" directoryIndex\\ " : \\" /\\ "
101101} )
102102
You can’t perform that action at this time.
0 commit comments