#1: added pwa config and manifest

This commit is contained in:
Elmar Kresse
2024-04-25 09:08:01 +02:00
parent 24cbcf0ead
commit 5bf2dbcc7a
14 changed files with 365 additions and 13 deletions

View File

@@ -17,16 +17,64 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { fileURLToPath } from "node:url";
import { VitePWA } from 'vite-plugin-pwa'
import { VitePWA } from 'vite-plugin-pwa';
import mkcert from 'vite-plugin-mkcert';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
mkcert(),
VitePWA({
mode: 'development',
base: '/',
injectRegister: 'auto',
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'],
manifest: {
name: 'HTWKalender',
short_name: 'HTWKalender',
description: 'Calendar implementation for the HTWK Leipzig timetable. Evaluation and display of the individual dates in iCal format.',
theme_color: '#FFFFFF',
background_color: '#FFFFFF',
display: 'standalone',
start_url: '/',
icons: [
{
src: "/pwa-192x192.png",
sizes: "192x192",
type: "image/png",
purpose: "any"
},
{
src: "/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any"
},
{
src: "/pwa-maskable-192x192.png",
sizes: "192x192",
type: "image/png",
purpose: "maskable"
},
{
src: "/pwa-maskable-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable"
}
],
},
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,json,vue,txt,woff2}'],
cleanupOutdatedCaches: true
},
devOptions: {
enabled: true
enabled: true,
/* when using generateSW the PWA plugin will switch to classic */
type: 'module',
navigateFallback: 'index.html',
suppressWarnings: true,
}
})],
resolve: {