From 240d959d41ac4bcd89430602c29276754a7e03c5 Mon Sep 17 00:00:00 2001 From: subnub Date: Fri, 21 Feb 2025 12:58:26 -0500 Subject: [PATCH] PWA test --- package.json | 3 ++- vite.config.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e0981d5..1ad6632 100755 --- a/package.json +++ b/package.json @@ -130,6 +130,7 @@ "superagent-binary-parser": "^1.0.1", "supertest": "^6.3.4", "tailwindcss": "^3.4.4", - "typescript-eslint": "^7.14.1" + "typescript-eslint": "^7.14.1", + "vite-plugin-pwa": "^0.21.1" } } diff --git a/vite.config.ts b/vite.config.ts index 9804244..6fd3941 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,7 @@ import { defineConfig, loadEnv } from "vite"; import react from "@vitejs/plugin-react"; import { visualizer } from "rollup-plugin-visualizer"; +import { VitePWA } from "vite-plugin-pwa"; export default defineConfig(({ mode }) => { const env = loadEnv(mode, "./src/config/"); @@ -10,7 +11,13 @@ export default defineConfig(({ mode }) => { console.log(`\nBackend Development Proxy URL: ${proxyURL}/api\n`); return { - plugins: [react(), visualizer()], + plugins: [ + react(), + visualizer(), + VitePWA({ + registerType: "autoUpdate", + }), + ], build: { outDir: "dist-frontend", },