-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): 🔗 bump packages and add serwist
- Loading branch information
1 parent
6b845bd
commit cb1f1fc
Showing
11 changed files
with
2,368 additions
and
4,154 deletions.
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
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
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,25 @@ | ||
import { defaultCache } from "@serwist/next/worker"; | ||
import type { PrecacheEntry, SerwistGlobalConfig } from "serwist"; | ||
import { Serwist } from "serwist"; | ||
|
||
// This declares the value of `injectionPoint` to TypeScript. | ||
// `injectionPoint` is the string that will be replaced by the | ||
// actual precache manifest. By default, this string is set to | ||
// `"self.__SW_MANIFEST"`. | ||
declare global { | ||
interface WorkerGlobalScope extends SerwistGlobalConfig { | ||
__SW_MANIFEST: (PrecacheEntry | string)[] | undefined; | ||
} | ||
} | ||
|
||
declare const self: ServiceWorkerGlobalScope; | ||
|
||
const serwist = new Serwist({ | ||
precacheEntries: self.__SW_MANIFEST, | ||
skipWaiting: true, | ||
clientsClaim: true, | ||
navigationPreload: true, | ||
runtimeCaching: defaultCache, | ||
}); | ||
|
||
serwist.addEventListeners(); |
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
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
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
Oops, something went wrong.