Skip to content

Commit 93d9e7d

Browse files
ChriztiaanChristiaan Landman
andauthored
chore added PWA support to Vue demo (#129)
Co-authored-by: Christiaan Landman <christiaanlandman@Christiaans-MacBook-Pro-2.local>
1 parent 38ee602 commit 93d9e7d

File tree

7 files changed

+88
-13
lines changed

7 files changed

+88
-13
lines changed

.changeset/chatty-news-appear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vue-supabase-todolist": patch
3+
---
4+
5+
Added PWA support.

demos/vue-supabase-todolist/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ components.d.ts
2525
*.njsproj
2626
*.sln
2727
*.sw?
28+
29+
# PWA
30+
**/public/workbox-*.js
31+
**/public/sw.js
32+
**/public/swe-worker-*
33+
**/public/worker-*.js
34+
**/public/fallback-*.js

demos/vue-supabase-todolist/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"unplugin-fonts": "^1.1.1",
3131
"unplugin-vue-components": "^0.26.0",
3232
"vite": "^5.2.0",
33+
"vite-plugin-pwa": "^0.19.2",
3334
"vite-plugin-top-level-await": "^1.4.1",
3435
"vite-plugin-vuetify": "^2.0.3",
3536
"vite-plugin-wasm": "^3.3.0",
Lines changed: 1 addition & 0 deletions
Loading
45.3 KB
Loading

demos/vue-supabase-todolist/vite.config.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Vue from '@vitejs/plugin-vue';
55
import ViteFonts from 'unplugin-fonts/vite';
66
import Components from 'unplugin-vue-components/vite';
77
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
8+
import { VitePWA } from 'vite-plugin-pwa';
89

910
// Utilities
1011
import { fileURLToPath, URL } from 'node:url';
@@ -29,6 +30,41 @@ export default defineConfig({
2930
}
3031
]
3132
}
33+
}),
34+
VitePWA({
35+
registerType: 'autoUpdate',
36+
includeAssets: ['powersync-logo.svg', 'supabase-logo.png', 'favicon.ico'],
37+
manifest: {
38+
theme_color: '#c44eff',
39+
background_color: '#c44eff',
40+
display: 'standalone',
41+
scope: '/',
42+
start_url: '/',
43+
name: 'PowerSync Vue Demo',
44+
short_name: 'PowerSync Vue',
45+
icons: [
46+
{
47+
src: '/icons/icon-192x192.png',
48+
sizes: '192x192',
49+
type: 'image/png'
50+
},
51+
{
52+
src: '/icons/icon-256x256.png',
53+
sizes: '256x256',
54+
type: 'image/png'
55+
},
56+
{
57+
src: '/icons/icon-384x384.png',
58+
sizes: '384x384',
59+
type: 'image/png'
60+
},
61+
{
62+
src: '/icons/icon-512x512.png',
63+
sizes: '512x512',
64+
type: 'image/png'
65+
}
66+
]
67+
}
3268
})
3369
],
3470
define: { 'process.env': {} },

pnpm-lock.yaml

Lines changed: 38 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)