Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/// <reference types="vite/client" />
/// <reference types="vite-plugin-pwa/client" />
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<link rel="icon" href="/favicon-96x96.png" type="image/png" sizes="96x96" />
<link rel="icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Git Calendar Web</title>
</head>
Expand Down
7,681 changes: 6,089 additions & 1,592 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"prettier": "3.8.3",
"typescript": "~6.0.3",
"vite": "^8.0.10",
"vite-plugin-pwa": "^1.3.0",
"vite-plugin-vue-devtools": "^8.1.1",
"vue-tsc": "^3.2.7"
}
Expand Down
30 changes: 0 additions & 30 deletions public/site.webmanifest

This file was deleted.

6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import '@/assets/styles.css';
import '@/composables/useSettings.ts'; // init settings
import { useTranslation } from '@/composables/useTranslation';

import { registerSW } from 'virtual:pwa-register';

registerSW({
immediate: true,
});

const { i18n } = useTranslation();

const app = createApp(App);
Expand Down
40 changes: 39 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,48 @@ import { fileURLToPath, URL } from 'node:url';

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { VitePWA } from 'vite-plugin-pwa';

// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [
vue(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Git Calendar Web',
short_name: 'Git Cal',
id: 'Git Cal',
start_url: '/',
description: 'A web client for a Git-backed calendar.',
display: 'standalone',
background_color: '#ffffff',
theme_color: '#ffffff',
orientation: 'portrait-primary',
icons: [
{
src: '/icon-192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/icon-512.png',
sizes: '512x512',
type: 'image/png',
},
],
lang: 'en',
dir: 'ltr',
},

workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,woff2,wasm}'],
maximumFileSizeToCacheInBytes: 25 * 1024 * 1024, // 25MiB (core.wasm is a big boy)
cleanupOutdatedCaches: true,
navigateFallback: '/index.html',
},
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
Expand Down