correct SW field
config.sw should point to uv.sw.js, not the stock sw.js we now use a fixed path in register-sw.js
This commit is contained in:
parent
9fa709d98f
commit
d75d7fde3a
2 changed files with 8 additions and 2 deletions
|
|
@ -1,4 +1,9 @@
|
|||
"use strict";
|
||||
/**
|
||||
* Distributed with Ultraviolet and compatible with most configurations.
|
||||
*/
|
||||
const stockSW = "/uv/sw.js";
|
||||
|
||||
/**
|
||||
* Global util
|
||||
* Used in 404.html and index.html
|
||||
|
|
@ -7,7 +12,8 @@ async function registerSW() {
|
|||
if (!navigator.serviceWorker)
|
||||
throw new Error("Your browser doesn't support service workers.");
|
||||
|
||||
await navigator.serviceWorker.register(__uv$config.sw, {
|
||||
// Ultraviolet has a stock `sw.js` script.
|
||||
await navigator.serviceWorker.register(stockSW, {
|
||||
scope: __uv$config.prefix,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ self.__uv$config = {
|
|||
handler: "/uv/uv.handler.js",
|
||||
bundle: "/uv/uv.bundle.js",
|
||||
config: "/uv/uv.config.js",
|
||||
sw: "/uv/sw.js",
|
||||
sw: "/uv/uv.sw.js",
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue