Open
Description
I'm trying to register my service worker manually so that it only gets registered when visiting specific URLs in my app. I've set injectRegister: false
thinking it would not register the SW. But even so, and even if I don't install it manually, I can still see the service working being registered and pre-caching data in the dev tools?? How can I register it manually?
This is the current config:
pwa: {
scope: '/',
base: '/',
manifest: false,
injectRegister: false,
registerType: 'prompt',
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
runtimeCaching: [
{
urlPattern: ({ url }) => url.origin === 'https://myapp.directus.app',
handler: 'NetworkFirst',
options: {
cacheName: 'directus-cache'
}
},
{
urlPattern: ({ request }) => request.destination === 'video',
handler: 'CacheFirst',
options: {
cacheName: 'video-cache'
}
}
],
navigateFallback: undefined,
maximumFileSizeToCacheInBytes: 50 * 1024 * 1024 // 50MB,
}
},
Metadata
Metadata
Assignees
Labels
No labels