Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I noticed that app shell isn't correctly cached by the service worker. Consequently PWA doesn't start correctly. **Steps to reproduce** - Build and serve the app: `trunk serve` - Open app in the browser (chromium) - Click "Install egui Template PWA" - Close PWA - Stop the server (trunk) - Start previously installed PWA **Proposed solution** 1. trunkrs adds hashes to the file names: `eframe_template-*`. This makes paths in `sw.js` under `filesToCache` invalid. I solved it by adding `filehash = false`. The other option could be generating `sw.js` with correct filenames in `post_build` hook of trunkrs. 2. I noticed that when `manifest.json` is served from `assets/`, then installed PWA starts from attempting to read `assets/index.html` from cache. The file is non-existing, so startup fails. I solved it by moving `manifest.json` to the root directory. This required relative paths in `manifest.json` to be updated.
- Loading branch information