Skip to content

Commit 63d5c03

Browse files
authored
Merge pull request #218 from cartridge-gg/lattice/1774647610
fix: remove PWA service worker caching
2 parents 876029b + 6f5547d commit 63d5c03

File tree

4 files changed

+190
-2638
lines changed

4 files changed

+190
-2638
lines changed

client/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@
88
/>
99
<link rel="icon" type="image/x-icon" href="favicon.ico" />
1010
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
11-
<link rel="manifest" href="/manifest.webmanifest" />
1211
<meta name="theme-color" content="#591FFF" />
13-
<meta name="application-name" content="Glitch Bomb" />
14-
<meta name="apple-mobile-web-app-capable" content="yes" />
15-
<meta name="apple-mobile-web-app-title" content="Glitch Bomb" />
16-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
17-
<meta name="mobile-web-app-capable" content="yes" />
1812
<link rel="preconnect" href="https://fonts.googleapis.com" />
1913
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
2014
<link
@@ -25,6 +19,14 @@
2519
</head>
2620
<body>
2721
<div id="root"></div>
22+
<script>
23+
// Unregister any existing service workers from the old PWA setup
24+
if ("serviceWorker" in navigator) {
25+
navigator.serviceWorker.getRegistrations().then((registrations) => {
26+
for (var r of registrations) r.unregister();
27+
});
28+
}
29+
</script>
2830
<script type="module" src="/src/main.tsx"></script>
2931
</body>
3032
</html>

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"typescript": "^5.5.4",
9696
"typescript-eslint": "^8.0.0",
9797
"vite": "^5.2.0",
98-
"vite-plugin-pwa": "^1.0.3",
98+
9999
"vite-plugin-static-copy": "^2.2.0",
100100
"vite-tsconfig-paths": "^5.1.4"
101101
},

client/vite.config.ts

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,14 @@ import path from "node:path";
22
import react from "@vitejs/plugin-react";
33
import { defineConfig } from "vite";
44
import mkcert from "vite-plugin-mkcert";
5-
import { VitePWA } from "vite-plugin-pwa";
5+
66
import topLevelAwait from "vite-plugin-top-level-await";
77
import wasm from "vite-plugin-wasm";
88
import tsconfigPaths from "vite-tsconfig-paths";
99

1010
// https://vitejs.dev/config/
1111
export default defineConfig({
12-
plugins: [
13-
react(),
14-
wasm(),
15-
topLevelAwait(),
16-
tsconfigPaths(),
17-
mkcert(),
18-
VitePWA({
19-
registerType: "autoUpdate",
20-
workbox: {
21-
maximumFileSizeToCacheInBytes: 4000000, // 4 MB
22-
navigateFallback: "/index.html",
23-
},
24-
includeAssets: ["apple-touch-icon.png"],
25-
manifest: {
26-
name: "Glitch Bomb",
27-
short_name: "Glitch Bomb",
28-
description: "Play Glitch Bomb and manage your on-chain profile.",
29-
start_url: "/",
30-
scope: "/",
31-
id: "/",
32-
icons: [
33-
{
34-
src: "/web-app-manifest-192x192.png",
35-
sizes: "192x192",
36-
type: "image/png",
37-
purpose: "any",
38-
},
39-
{
40-
src: "/web-app-manifest-512x512.png",
41-
sizes: "512x512",
42-
type: "image/png",
43-
purpose: "any",
44-
},
45-
{
46-
src: "/web-app-manifest-192x192-maskable.png",
47-
sizes: "192x192",
48-
type: "image/png",
49-
purpose: "maskable",
50-
},
51-
{
52-
src: "/web-app-manifest-512x512-maskable.png",
53-
sizes: "512x512",
54-
type: "image/png",
55-
purpose: "maskable",
56-
},
57-
],
58-
theme_color: "#591FFF",
59-
background_color: "#591FFF",
60-
display: "standalone",
61-
},
62-
}),
63-
],
12+
plugins: [react(), wasm(), topLevelAwait(), tsconfigPaths(), mkcert()],
6413
resolve: {
6514
alias: {
6615
"@": path.resolve(__dirname, "./src"),

0 commit comments

Comments
 (0)