Files
ridebus-pwa/vite.config.ts
Zakhar Timoshenko 6fe039cefa feat: add StopsMap and WalkingDirections components for enhanced map functionality
- Implemented StopsMap component to display bus stops on a map using MapLibre GL.
- Integrated walking directions feature in WalkingDirections component to calculate routes from user location to selected bus stop.
- Added geo utility functions for coordinate validation and distance calculation.
- Created route grouping and stop filtering logic in routeGroups module.
- Developed custom hooks for managing stop routes with React Query.
- Added tests for routing and stop functionalities to ensure reliability.
2026-10-08 00:18:10 +03:00

42 lines
1.5 KiB
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: 'prompt',
includeAssets: ['logo.svg', 'star.svg', 'apple-touch-icon.png'],
manifest: {
id: '/',
name: 'RideBus — расписание транспорта',
short_name: 'RideBus',
description: 'Остановки, ближайшие отправления и избранное',
lang: 'ru',
start_url: '/',
scope: '/',
display: 'standalone',
background_color: '#faf9f6',
theme_color: '#f3f3fa',
icons: [
{ src: '/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' },
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any' },
{ src: '/icon-maskable.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
],
},
workbox: {
globPatterns: ['**/*.{js,css,html,woff2,png,svg,webmanifest}'],
// The map is online-only and loads on demand; keep the offline shell small.
globIgnores: ['**/StopsMap-*', '**/maplibre-gl-worker-*'],
navigateFallbackDenylist: [/^\/api\//],
// API snapshots are kept in IndexedDB, keyed by city and stop.
// The service worker only caches the application shell.
cleanupOutdatedCaches: true,
clientsClaim: true,
},
}),
],
build: { target: 'es2022' },
});