fix: remove PWA service worker that breaks Stalwart /admin and /account mounts

This commit is contained in:
Steven RYDELL
2026-07-30 18:30:36 +02:00
parent 4e089d9b6b
commit eda9c9c8bf
5 changed files with 7 additions and 615 deletions
+5 -30
View File
@@ -1,7 +1,6 @@
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { VitePWA } from 'vite-plugin-pwa'
import path from 'path'
import { version } from './package.json'
@@ -10,35 +9,7 @@ export default defineConfig({
define: {
__APP_VERSION__: JSON.stringify(version),
},
plugins: [
react(),
tailwindcss(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico'],
manifest: {
name: 'Stalwart WebUI',
short_name: 'Stalwart',
description: 'Administration panel for Stalwart Mail Server',
start_url: '/',
scope: '/',
display: 'standalone',
theme_color: '#db2d54',
background_color: '#ffffff',
icons: [
{ src: 'pwa/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' },
{ src: 'pwa/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any' },
{ src: 'pwa/maskable-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
],
},
workbox: {
// /api and /jmap serve authenticated mail data: never precache or
// runtime-cache them, always hit the network so an installed PWA
// can't show stale or cross-account data from a previous session.
navigateFallbackDenylist: [/^\/api/, /^\/jmap/],
},
}),
],
plugins: [react(), tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
@@ -51,6 +22,10 @@ export default defineConfig({
'/api': { target: 'http://localhost:8080', changeOrigin: true, ws: true },
'/jmap': { target: 'http://localhost:8080', changeOrigin: true, ws: true },
},
watch: {
// Release artifacts lock on Windows and crash the watcher (EBUSY).
ignored: ['**/webui.zip', '**/release_body.md'],
},
},
test: {
globals: false,