-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Service worker using rescript and Cache fixed
- Loading branch information
Showing
7 changed files
with
41 additions
and
32 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 was deleted.
Oops, something went wrong.
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,19 @@ | ||
// NOTE: To debug this module in the navigator use: yarn build && yarn preview | ||
|
||
type entry = { | ||
url: string, | ||
revision: string | ||
} | ||
|
||
@module("workbox-precaching") external precacheAndRoute: array<entry> => unit = "precacheAndRoute" | ||
|
||
@module("workbox-precaching") external cleanupOutdatedCaches: unit => unit = "cleanupOutdatedCaches" | ||
|
||
@scope("self") external entries: array<entry> = "__WB_MANIFEST" | ||
|
||
// Ref. https://developer.chrome.com/docs/workbox/modules/workbox-precaching | ||
// self.__WB_MANIFEST contains the cacheable entries listed by VitePWA pluggin | ||
precacheAndRoute(entries) | ||
|
||
// clean old assets | ||
cleanupOutdatedCaches() |
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