- Defines the PWA metadata (name, icons, display mode, etc.)
- Configures app as "standalone" mode (full-screen)
- Defines theme colors, start URL, and app categories
- Includes shortcut for quick game access
- Has support for maskable icons for modern devices
- Handles offline functionality with cache strategy
- Caches app assets on first visit
- Uses "cache-first" strategy for faster loads
- Falls back to network for fresh content
- Manages cache updates and cleanup
- Enables offline-first experience
manifest.jsonlink- PWA capability meta tags for iOS and Android
- Theme color configuration
- Apple mobile app support
- Responsive viewport settings
- Registers service worker on app load
- Checks for updates every minute
- Handles automatic page refresh when new version is available
- Error handling for registration failures
- Added
Service-Worker-Allowedheader for proper SW scope - Configured build output for PWA deployment
Create icons in public/icons/:
icon-192x192.png- Standard app iconicon-512x512.png- Large icon for splash screensicon-maskable-192x192.png- Masked icon (safe zone only)icon-maskable-512x512.png- Large masked iconplay-192x192.png- Shortcut icon (optional)
Generate icons:
- Use online tools: https://pwabuilder.com (Image Generator)
- Or convert your game logo to PNG in these sizes
Create screenshots in public/screenshots/:
screenshot-540x720.png- Mobile view (tall)screenshot-1280x720.png- Desktop/tablet view (wide)
npm run buildnpm run previewThen open DevTools (F12) > Application > Service Workers to verify registration
- Host the
dist/folder on HTTPS (required for PWA) - Service Worker requires secure context (HTTPS)
- Open DevTools (F12)
- Go to Application tab
- Check Service Workers - should show "activated and running"
- Check Cache Storage - should have 'carrot-flight-v1'
- Click Install app button in the browser address bar
- Open the app URL in Chrome
- Tap menu (⋮) → Install app
- Or tap Install banner if shown
- Open the app URL in Safari
- Tap Share button → Add to Home Screen
- Tap Add to install
✅ Installable - Add to home screen ✅ Standalone - Runs like a native app (no browser UI) ✅ Offline Support - Works without internet ✅ Fast Loading - Cached assets load instantly ✅ Auto Updates - Service worker checks for updates ✅ Responsive - Works on all screen sizes ✅ Secure - HTTPS required
The service worker uses a "cache-first with network fallback" strategy:
- Check local cache for the resource
- If found in cache, serve immediately
- If not in cache, fetch from network
- Cache the network response for future use
- If offline, return cached version or index.html
This provides fast performance while supporting offline functionality.
Service Worker not registering?
- Check browser console for errors
- Ensure you're using HTTPS (or localhost for development)
- Check that
/sw.jsis being served correctly
Cache not updating?
- Service worker checks for updates every minute
- Force refresh (Ctrl+Shift+R) to get latest version
- Clear application cache in DevTools if needed
Icons not showing?
- Generate and place icons in
public/icons/folder - Ensure PNG format and correct dimensions
- Clear browser cache and reinstall app
- PWA Builder Studio - Full PWA setup tool
- MDN Web Docs - PWA
- Web.dev PWA Checklist