|
1 | | -import { defineConfig } from 'vite' |
2 | | -import react from '@vitejs/plugin-react' |
3 | | -import { VitePWA } from 'vite-plugin-pwa' |
| 1 | +import { defineConfig } from "vite"; |
| 2 | +import react from "@vitejs/plugin-react"; |
| 3 | +import { VitePWA } from "vite-plugin-pwa"; |
4 | 4 |
|
5 | 5 | // https://vite.dev/config/ |
6 | 6 | export default defineConfig({ |
7 | 7 | plugins: [ |
8 | 8 | react(), |
9 | 9 | VitePWA({ |
10 | | - registerType: 'prompt', |
11 | | - includeAssets: ['logo.svg', 'concert_one_latin.woff2'], |
| 10 | + registerType: "prompt", |
| 11 | + includeAssets: ["logo.svg"], |
12 | 12 | manifest: { |
13 | | - name: 'Learningmap - Interactive Visual Maps for Teaching and Learning', |
14 | | - short_name: 'Learningmap', |
15 | | - description: 'Create, share, and explore interactive visual learning maps. Perfect for teachers and students. All data stored locally in your browser for privacy and offline access.', |
16 | | - theme_color: '#ffffff', |
17 | | - background_color: '#ffffff', |
18 | | - display: 'standalone', |
19 | | - scope: '/', |
20 | | - start_url: '/', |
| 13 | + name: "Learningmap - Interactive Visual Maps for Teaching and Learning", |
| 14 | + short_name: "Learningmap", |
| 15 | + description: |
| 16 | + "Create, share, and explore interactive visual learning maps. Perfect for teachers and students. All data stored locally in your browser for privacy and offline access.", |
| 17 | + theme_color: "#ffffff", |
| 18 | + background_color: "#ffffff", |
| 19 | + display: "standalone", |
| 20 | + scope: "/", |
| 21 | + start_url: "/", |
21 | 22 | icons: [ |
22 | 23 | { |
23 | | - src: 'pwa-192x192.png', |
24 | | - sizes: '192x192', |
25 | | - type: 'image/png' |
| 24 | + src: "pwa-192x192.png", |
| 25 | + sizes: "192x192", |
| 26 | + type: "image/png", |
26 | 27 | }, |
27 | 28 | { |
28 | | - src: 'pwa-512x512.png', |
29 | | - sizes: '512x512', |
30 | | - type: 'image/png' |
| 29 | + src: "pwa-512x512.png", |
| 30 | + sizes: "512x512", |
| 31 | + type: "image/png", |
31 | 32 | }, |
32 | 33 | { |
33 | | - src: 'pwa-512x512.png', |
34 | | - sizes: '512x512', |
35 | | - type: 'image/png', |
36 | | - purpose: 'any maskable' |
37 | | - } |
38 | | - ] |
| 34 | + src: "pwa-512x512.png", |
| 35 | + sizes: "512x512", |
| 36 | + type: "image/png", |
| 37 | + purpose: "any maskable", |
| 38 | + }, |
| 39 | + ], |
39 | 40 | }, |
40 | 41 | workbox: { |
41 | | - globPatterns: ['**/*.{js,css,html,svg,png,woff2,json}'], |
| 42 | + globPatterns: ["**/*.{js,css,html,svg,png,woff2,json}"], |
42 | 43 | runtimeCaching: [ |
43 | 44 | { |
44 | 45 | urlPattern: /^https:\/\/json\.openpatch\.org\/.*/i, |
45 | | - handler: 'NetworkFirst', |
| 46 | + handler: "NetworkFirst", |
46 | 47 | options: { |
47 | | - cacheName: 'json-api-cache', |
| 48 | + cacheName: "json-api-cache", |
48 | 49 | expiration: { |
49 | 50 | maxEntries: 50, |
50 | | - maxAgeSeconds: 60 * 60 * 24 * 7 // 1 week |
| 51 | + maxAgeSeconds: 60 * 60 * 24 * 7, // 1 week |
51 | 52 | }, |
52 | 53 | cacheableResponse: { |
53 | | - statuses: [0, 200] |
54 | | - } |
55 | | - } |
56 | | - } |
57 | | - ] |
58 | | - } |
59 | | - }) |
| 54 | + statuses: [0, 200], |
| 55 | + }, |
| 56 | + }, |
| 57 | + }, |
| 58 | + ], |
| 59 | + }, |
| 60 | + }), |
60 | 61 | ], |
61 | | -}) |
| 62 | +}); |
0 commit comments