Добавлены изменения для PWA

This commit is contained in:
mi
2026-07-21 18:49:21 +03:00
parent 627371b221
commit cc0163eb94
22 changed files with 592 additions and 208 deletions
+22 -2
View File
@@ -10,11 +10,31 @@ npm install
npm run web
```
Проверки: `npm test`, `npm run typecheck`, `npm run build`, `npm run test:e2e`.
Проверки: `npm test`, `npm run typecheck`, `npm run build:pwa`, `npm run test:e2e`.
## PWA
Иконки лежат в `public/`:
| Файл | Размер |
|---|---|
| `favicon.png` | 64×64 |
| `icon-192.png` | 360×360 |
| `icon-512.png` | 1024×1024 |
| `apple-touch-icon.png` | 360×360 |
Manifest: `public/manifest.json`. Корневой HTML: `app/+html.tsx`.
```bash
npm run build:pwa # export + service-worker.js (Workbox)
npm run serve # локальная проверка dist/
```
Chrome DevTools → Application → Manifest / Service Workers. API и `/auth/` не кэшируются.
## Production
`npm run build` создаёт `dist/`. Каталог монтируется в корневой nginx системы; отдельный frontend nginx не используется. Для SPA nginx должен применять `try_files $uri /index.html`, не кэшировать `index.html` и бессрочно кэшировать hashed assets.
`npm run build:pwa` создаёт `dist/` с manifest, иконками и `service-worker.js`. Каталог монтируется в корневой nginx; отдельный frontend nginx не используется. Для SPA nginx должен применять `try_files $uri /index.html`, не кэшировать `index.html`, `manifest.json`, `service-worker.js` и бессрочно кэшировать hashed assets.
Dockerfile собирает статический OCI-артефакт `/dist` без runtime-сервера: