diff --git a/package.json b/package.json
index 803e372..3f5743e 100644
--- a/package.json
+++ b/package.json
@@ -24,6 +24,7 @@
"@sveltejs/kit": "^2.0.6",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@ubermanu/prettier-config": "^3.2.0",
+ "@vite-pwa/sveltekit": "^0.3.0",
"animate.css": "^4.1.1",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.32",
@@ -35,7 +36,8 @@
"tailwindcss": "^3.4.0",
"typescript": "^5.3.3",
"vite": "^5.0.10",
- "vite-plugin-pwa": "^0.17.4"
+ "vite-plugin-pwa": "^0.17.4",
+ "workbox-window": "^7.0.0"
},
"prettier": "@ubermanu/prettier-config"
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0d3be3e..5d4f20e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -20,6 +20,9 @@ devDependencies:
'@ubermanu/prettier-config':
specifier: ^3.2.0
version: 3.2.0(prettier-plugin-svelte@3.1.2)(prettier-plugin-tailwindcss@0.5.9)(prettier@3.1.1)
+ '@vite-pwa/sveltekit':
+ specifier: ^0.3.0
+ version: 0.3.0(@sveltejs/kit@2.0.6)(vite-plugin-pwa@0.17.4)
animate.css:
specifier: ^4.1.1
version: 4.1.1
@@ -56,6 +59,9 @@ devDependencies:
vite-plugin-pwa:
specifier: ^0.17.4
version: 0.17.4(vite@5.0.10)(workbox-build@7.0.0)(workbox-window@7.0.0)
+ workbox-window:
+ specifier: ^7.0.0
+ version: 7.0.0
packages:
@@ -1876,6 +1882,18 @@ packages:
- supports-color
dev: true
+ /@vite-pwa/sveltekit@0.3.0(@sveltejs/kit@2.0.6)(vite-plugin-pwa@0.17.4):
+ resolution: {integrity: sha512-cqVqHBm7kn3CQvNuBj21CSjf8Ub8rWhYJrYqr3qzQeWAm70ODASyaPc4vY8rwoxYGTnwWpgZ/ivJXmYV2G3j6Q==}
+ engines: {node: '>=16.14 || >=18.13'}
+ peerDependencies:
+ '@sveltejs/kit': ^1.3.1 || ^2.0.1
+ vite-plugin-pwa: '>=0.17.4 <1'
+ dependencies:
+ '@sveltejs/kit': 2.0.6(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@5.0.0-next.26)(vite@5.0.10)
+ kolorist: 1.8.0
+ vite-plugin-pwa: 0.17.4(vite@5.0.10)(workbox-build@7.0.0)(workbox-window@7.0.0)
+ dev: true
+
/acorn-typescript@1.4.12(acorn@8.11.2):
resolution: {integrity: sha512-G/oj3oiBmYlc+6SJZYMRz+SPgSgBWqEXPzhO55dYvT4x8SJM+HkxU5o5OPFstxsMMk1tXPYtYCyd7jUdHZy8Eg==}
peerDependencies:
@@ -3141,6 +3159,10 @@ packages:
engines: {node: '>=6'}
dev: true
+ /kolorist@1.8.0:
+ resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
+ dev: true
+
/leven@3.1.0:
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
engines: {node: '>=6'}
diff --git a/src/manifest.json b/src/manifest.json
index 2284d35..f0263d0 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -2,7 +2,6 @@
"name": "Audience",
"short_name": "Audience",
"description": "Crowd reaction soundboard",
- "theme_color": "#ffffff",
"icons": [
{
"src": "android-chrome-192x192.png",
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 3bcadc2..ed47f24 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,5 +1,18 @@
+
+ {@html pwaInfo?.webManifest.linkTag}
+
+
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
new file mode 100644
index 0000000..a5600f0
--- /dev/null
+++ b/src/vite-env.d.ts
@@ -0,0 +1,2 @@
+///
+///
diff --git a/vite.config.js b/vite.config.js
index e309c0d..d9018ed 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,12 +1,13 @@
import { sveltekit } from '@sveltejs/kit/vite'
+import { SvelteKitPWA } from '@vite-pwa/sveltekit'
import { defineConfig } from 'vite'
-import { VitePWA } from 'vite-plugin-pwa'
import manifest from './src/manifest.json'
export default defineConfig({
plugins: [
sveltekit(),
- VitePWA({
+ SvelteKitPWA({
+ strategies: 'generateSW',
registerType: 'autoUpdate',
manifest,
}),