PWA dan hosting
Output static
Section titled “Output static”app.json memakai web.output: "static". Dengan "single", +html.tsx custom diabaikan Expo sehingga manifest, theme-color, dan registrasi service worker tidak masuk ke HTML. Ini sudah diverifikasi saat F6.
Manifest
Section titled “Manifest”public/manifest.json: nama “Citarasa ERP”, short_name “Citarasa”, display: standalone, theme_color: #007838, tiga ikon (192, 512, 512 maskable) dari logo sticker Cita Rasa.
Service worker
Section titled “Service worker”public/sw.js (cache citarasa-shell-v1):
- Install: pre-cache
/laluskipWaiting. - Activate: hapus cache versi lama,
clients.claim. - Fetch: network-first untuk app shell, fallback ke cache saat offline. Panggilan
/apiselalu lewat network: belum offline-first.
Registrasi hanya terjadi di https: (lihat +html.tsx), jadi dev di localhost tidak memakai service worker. Bila mengubah isi sw.js, naikkan nama CACHE agar klien lama membuang cache.
Hosting
Section titled “Hosting”wrangler.toml:
name = "citarasa-mobile"main = "src/worker.ts"[assets]directory = "./dist"binding = "ASSETS"not_found_handling = "single-page-application"html_handling = "auto-trailing-slash"not_found_handling = "single-page-application" membuat rute yang tidak ada sebagai file (mis. /pesanan/ORD-...) tetap disajikan index.html dan ditangani Expo Router di klien.