forked from jsnbuchanan/crowd-funder-for-time-pwa
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:
@@ -24,14 +24,8 @@ export async function createOptimizedBuildConfig(mode: string): Promise<UserConf
|
||||
const isElectron = mode === "electron";
|
||||
const isNative = isCapacitor || isElectron;
|
||||
|
||||
// Set platform and disable PWA for native platforms
|
||||
// Set platform - PWA is always enabled for web platforms
|
||||
process.env.VITE_PLATFORM = mode;
|
||||
process.env.VITE_PWA_ENABLED = isNative ? 'false' : 'true';
|
||||
process.env.VITE_DISABLE_PWA = isNative ? 'true' : 'false';
|
||||
|
||||
if (isNative) {
|
||||
process.env.VITE_PWA_ENABLED = 'false';
|
||||
}
|
||||
|
||||
return {
|
||||
base: "/",
|
||||
@@ -93,8 +87,8 @@ export async function createOptimizedBuildConfig(mode: string): Promise<UserConf
|
||||
define: {
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
'process.env.VITE_PLATFORM': JSON.stringify(mode),
|
||||
'process.env.VITE_PWA_ENABLED': JSON.stringify(!isNative),
|
||||
'process.env.VITE_DISABLE_PWA': JSON.stringify(isNative),
|
||||
|
||||
|
||||
__dirname: JSON.stringify(process.cwd()),
|
||||
__IS_MOBILE__: JSON.stringify(isCapacitor),
|
||||
__IS_ELECTRON__: JSON.stringify(isElectron),
|
||||
|
||||
Reference in New Issue
Block a user