Fix service worker (#2433)
Regression from #2267. This fixes the service-worker and switches from injecting the manifest into a pre-provided service-worker to generating the service-worker during webpack builder. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>pull/2436/head
parent
ea28f32140
commit
5159566e02
|
@ -265,9 +265,13 @@ module.exports = {
|
|||
]
|
||||
}),
|
||||
...(env === 'production' ? [
|
||||
new WorkboxPlugin.InjectManifest({
|
||||
swSrc: resolvePath('src/service-worker.js'),
|
||||
new WorkboxPlugin.GenerateSW({
|
||||
swDest: 'service-worker.js',
|
||||
maximumFileSizeToCacheInBytes: 100000000,
|
||||
// these options encourage the ServiceWorkers to get in there fast
|
||||
// and not allow any straggling "old" SWs to hang around
|
||||
clientsClaim: true,
|
||||
skipWaiting: true
|
||||
})
|
||||
] : []),
|
||||
...(env === 'production' ? [
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"allowSyntheticDefaultImports": false,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/*"],
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules", "node", "build", "assets-src", "www", "test"]
|
||||
|
|
|
@ -326,7 +326,7 @@ export default {
|
|||
|
||||
// Register service worker
|
||||
serviceWorker: (location.hostname === 'localhost') ? {} : {
|
||||
path: '/service-worker.js'
|
||||
path: './service-worker.js'
|
||||
},
|
||||
card: {
|
||||
swipeToClose: true
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
// manifest import and workbox imports will be autogenerated by webpack
|
||||
// eslint-disable-next-line no-undef
|
||||
workbox.precaching.precacheAndRoute(self.__WB_MANIFEST)
|
Loading…
Reference in New Issue