add better pwa support

This commit is contained in:
Viktor Rådberg
2024-01-14 14:38:56 +01:00
parent e153de9093
commit 81f3891b20
3 changed files with 1858 additions and 28 deletions

View File

@@ -45,6 +45,7 @@
"prettier": "2.8.8",
"tailwindcss": "^3.4.0",
"typescript": "^5.0.2",
"vite": "^4.4.5"
"vite": "^4.4.5",
"vite-plugin-pwa": "^0.17.4"
}
}

View File

@@ -1,9 +1,19 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
workbox: {
clientsClaim: true,
skipWaiting: true,
},
}),
],
build: {
minify: 'esbuild',
rollupOptions: {

1869
yarn.lock

File diff suppressed because it is too large Load Diff