From b4207f27821617d83e4cf018c169ca3bac30fda1 Mon Sep 17 00:00:00 2001 From: Bastien Wirtz Date: Sun, 3 Jul 2022 21:40:47 +0200 Subject: new PWA implementation --- vite.config.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'vite.config.js') diff --git a/vite.config.js b/vite.config.js index 87f098b..0400b78 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,3 +1,4 @@ +import { VitePWA } from 'vite-plugin-pwa' import { fileURLToPath, URL } from "url"; import { defineConfig } from "vite"; @@ -5,7 +6,35 @@ import vue from "@vitejs/plugin-vue"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + build: { + assetsDir: "resources", + }, + plugins: [ + vue(), + VitePWA({ + registerType: 'autoUpdate', + useCredentials: true, + manifestFilename: "assets/manifest.json", + manifest: { + name: 'Homer dashboard', + short_name: 'Homer', + description: 'Home Server Dashboard', + theme_color: '#3367D6', + icons: [ + { + src: 'pwa-192x192.png', + sizes: '192x192', + type: 'image/png' + }, + { + src: 'pwa-512x512.png', + sizes: '512x512', + type: 'image/png' + } + ], + }, + }) + ], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), -- cgit v1.2.3