mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(web): PWA asset and route handling (#898)
* fix(web): PWA asset and fallback route handling * fix(web): strip baseurl * fix(web): add back manifest.json * fix(web): add back manifest.json * fix(web): log file * fix(web): do not trim baseurl * fix(web): try different start_url * fix(web): pwa with subfolder
This commit is contained in:
parent
d085d894d4
commit
319bc2f200
7 changed files with 110 additions and 30 deletions
|
@ -13,12 +13,16 @@ export default ({ mode }: { mode: any }) => {
|
|||
base: "",
|
||||
plugins: [react(), VitePWA({
|
||||
registerType: "autoUpdate",
|
||||
injectRegister: "auto",
|
||||
injectRegister: "inline",
|
||||
scope: "{{.BaseUrl}}",
|
||||
// strategies: "injectManifest",
|
||||
useCredentials: true,
|
||||
includeAssets: [
|
||||
"favicon.svg",
|
||||
"favicon.ico",
|
||||
"robots.txt",
|
||||
"apple-touch-icon.png",
|
||||
"logo.png",
|
||||
"apple-touch-icon-*.png",
|
||||
"manifest.webmanifest",
|
||||
"assets/**/*"
|
||||
],
|
||||
|
@ -29,6 +33,11 @@ export default ({ mode }: { mode: any }) => {
|
|||
theme_color: "#141415",
|
||||
background_color: "#141415",
|
||||
icons: [
|
||||
{
|
||||
src: "logo.png",
|
||||
sizes: "192x192",
|
||||
type: "image/png"
|
||||
},
|
||||
{
|
||||
src: "logo192.png",
|
||||
sizes: "192x192",
|
||||
|
@ -39,17 +48,21 @@ export default ({ mode }: { mode: any }) => {
|
|||
sizes: "512x512",
|
||||
type: "image/png"
|
||||
},
|
||||
|
||||
{
|
||||
src: "logo512.png",
|
||||
sizes: "512x512",
|
||||
type: "image/png",
|
||||
purpose: "any maskable"
|
||||
},
|
||||
{
|
||||
src: "apple-touch-icon-iphone-retina-120x120.png",
|
||||
sizes: "120x120",
|
||||
type: "image/png"
|
||||
}
|
||||
],
|
||||
start_url: "/",
|
||||
start_url: "{{.BaseUrl}}",
|
||||
scope: "{{.BaseUrl}}",
|
||||
display: "standalone"
|
||||
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ["**/*.{js,css,html,svg}"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue