service worker: use injectManifest
- a RPC framework is added for further use - fix an error that the service worker is not registered until the settings opened - added theme-color - settings: added a item to indicate the offline availablity
This commit is contained in:
parent
3ea7072437
commit
559a352bc1
11 changed files with 341 additions and 19 deletions
|
@ -16,10 +16,16 @@ export default defineConfig(({ mode }) => ({
|
|||
},
|
||||
}),
|
||||
VitePWA({
|
||||
strategies: "injectManifest",
|
||||
registerType: "autoUpdate",
|
||||
devOptions: {
|
||||
enabled: mode === "staging",
|
||||
enabled: mode === "staging" || mode === "dev",
|
||||
},
|
||||
srcDir: "src/serviceworker",
|
||||
filename: "main.ts",
|
||||
manifest: {
|
||||
theme_color: "#673ab7"
|
||||
}
|
||||
}),
|
||||
version(),
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue