Skip to content

Commit a3fa86b

Browse files
committed
feat(qwik cli): add service-worker
1 parent da5ed64 commit a3fa86b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"description": "Add a service worker to your app",
3+
"__qwik__": {
4+
"displayName": "Feature: Service Worker",
5+
"priority": 10,
6+
"docs": [],
7+
"nextSteps": {
8+
"lines": [
9+
"Now, make sure that you have `<RegisterServiceWorker />` in your `src/root.tsx`"
10+
]
11+
}
12+
}
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* WHAT IS THIS FILE?
3+
*
4+
* Any file called "service-worker" is automatically bundled and registered with Qwik Router, as long as you add `<RegisterServiceWorker />` in your `root.tsx`.
5+
*
6+
* Here you register the events that your service worker will handle.
7+
*
8+
* MDN has documentation at https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
9+
*/
10+
export declare const self: ServiceWorkerGlobalScope;
11+
12+
addEventListener("install", () => self.skipWaiting());
13+
14+
addEventListener("activate", () => self.clients.claim());

0 commit comments

Comments
 (0)