Remove manual service worker registration; rely on VitePWA auto-registration
- Deleted src/registerServiceWorker.ts and all related imports - Cleaned up WebPlatformService and main.web.ts to remove manual SW logic - Updated VitePWA config for correct dev/prod SW handling - Fixed missing FontAwesome download icon in PWA prompt - Updated docs to reflect new PWA registration approach PWA now works reliably in all web environments with zero manual SW code.
This commit is contained in:
@@ -178,27 +178,19 @@ setup_build_env() {
|
||||
case $build_type in
|
||||
"capacitor")
|
||||
export VITE_PLATFORM=capacitor
|
||||
export VITE_PWA_ENABLED=false
|
||||
export VITE_DISABLE_PWA=true
|
||||
export DEBUG_MIGRATIONS=0
|
||||
;;
|
||||
"electron")
|
||||
export VITE_PLATFORM=electron
|
||||
export VITE_PWA_ENABLED=false
|
||||
export VITE_DISABLE_PWA=true
|
||||
export DEBUG_MIGRATIONS=0
|
||||
;;
|
||||
"web")
|
||||
export VITE_PLATFORM=web
|
||||
export VITE_PWA_ENABLED=true
|
||||
export VITE_DISABLE_PWA=false
|
||||
export DEBUG_MIGRATIONS=0
|
||||
;;
|
||||
*)
|
||||
log_warn "Unknown build type: $build_type, using default environment"
|
||||
export VITE_PLATFORM=web
|
||||
export VITE_PWA_ENABLED=true
|
||||
export VITE_DISABLE_PWA=false
|
||||
export DEBUG_MIGRATIONS=0
|
||||
;;
|
||||
esac
|
||||
@@ -206,8 +198,6 @@ setup_build_env() {
|
||||
# Log environment setup
|
||||
log_debug "Environment variables set:"
|
||||
log_debug " VITE_PLATFORM=$VITE_PLATFORM"
|
||||
log_debug " VITE_PWA_ENABLED=$VITE_PWA_ENABLED"
|
||||
log_debug " VITE_DISABLE_PWA=$VITE_DISABLE_PWA"
|
||||
log_debug " DEBUG_MIGRATIONS=$DEBUG_MIGRATIONS"
|
||||
if [ -n "$NODE_ENV" ]; then
|
||||
log_debug " NODE_ENV=$NODE_ENV"
|
||||
|
||||
Reference in New Issue
Block a user