-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* | ||
* This file (which will be your service worker) | ||
* is picked up by the build system ONLY if | ||
* quasar.conf > pwa > workboxPluginMode is set to "InjectManifest" | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// THIS FEATURE-FLAG FILE IS AUTOGENERATED, | ||
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING | ||
import "quasar/dist/types/feature-flag"; | ||
|
||
declare module "quasar/dist/types/feature-flag" { | ||
interface QuasarFeatureFlags { | ||
pwa: true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { register } from 'register-service-worker' | ||
|
||
// The ready(), registered(), cached(), updatefound() and updated() | ||
// events passes a ServiceWorkerRegistration instance in their arguments. | ||
// ServiceWorkerRegistration: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration | ||
|
||
register(process.env.SERVICE_WORKER_FILE, { | ||
// The registrationOptions object will be passed as the second argument | ||
// to ServiceWorkerContainer.register() | ||
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#Parameter | ||
|
||
// registrationOptions: { scope: './' }, | ||
|
||
ready (/* registration */) { | ||
// console.log('Service worker is active.') | ||
}, | ||
|
||
registered (/* registration */) { | ||
// console.log('Service worker has been registered.') | ||
}, | ||
|
||
cached (/* registration */) { | ||
// console.log('Content has been cached for offline use.') | ||
}, | ||
|
||
updatefound (/* registration */) { | ||
// console.log('New content is downloading.') | ||
}, | ||
|
||
updated (/* registration */) { | ||
// console.log('New content is available; please refresh.') | ||
}, | ||
|
||
offline () { | ||
// console.log('No internet connection found. App is running in offline mode.') | ||
}, | ||
|
||
error (/* err */) { | ||
// console.error('Error during service worker registration:', err) | ||
} | ||
}) |