|
1 | | -import { defineConfig } from 'vite' |
2 | | -import { svelte } from '@sveltejs/vite-plugin-svelte' |
3 | | -import { VitePWA } from 'vite-plugin-pwa'; |
| 1 | +import { defineConfig } from "vite"; |
| 2 | +import { svelte } from "@sveltejs/vite-plugin-svelte"; |
| 3 | +import pkg from "./package.json" with { type: "json" }; |
| 4 | +import { VitePWA } from "vite-plugin-pwa"; |
4 | 5 |
|
5 | 6 | // https://vite.dev/config/ |
6 | 7 | export default defineConfig({ |
7 | 8 | plugins: [ |
8 | 9 | svelte(), |
9 | 10 | VitePWA({ |
10 | | - registerType: 'autoUpdate', |
11 | | - includeAssets: ['favicon.ico', 'apple-touch-icon.png'], |
| 11 | + registerType: "autoUpdate", |
| 12 | + includeAssets: ["favicon.ico", "apple-touch-icon.png"], |
12 | 13 | manifest: { |
13 | | - name: 'MyMusic Client Svelte PWA', |
14 | | - short_name: 'MyMusic Svelte PWA', |
15 | | - description: 'A Progressive Web App for MyMusic Client built with Svelte', |
16 | | - start_url: '/', |
17 | | - theme_color: '#212529', |
| 14 | + name: "MyMusic Client Svelte PWA", |
| 15 | + short_name: "MyMusic Svelte PWA", |
| 16 | + description: "A Progressive Web App for MyMusic Client built with Svelte", |
| 17 | + start_url: "/", |
| 18 | + theme_color: "#212529", |
18 | 19 | icons: [ |
19 | | - { |
20 | | - "src": "icons/icon-48x48.png", |
21 | | - "sizes": "48x48", |
22 | | - "type": "image/png" |
23 | | - }, |
24 | | - { |
25 | | - "src": "icons/icon-72x72.png", |
26 | | - "sizes": "72x72", |
27 | | - "type": "image/png" |
28 | | - }, |
29 | | - { |
30 | | - "src": "icons/icon-96x96.png", |
31 | | - "sizes": "96x96", |
32 | | - "type": "image/png" |
33 | | - }, |
34 | | - { |
35 | | - "src": "icons/icon-128x128.png", |
36 | | - "sizes": "128x128", |
37 | | - "type": "image/png" |
38 | | - }, |
39 | | - { |
40 | | - "src": "icons/icon-144x144.png", |
41 | | - "sizes": "144x144", |
42 | | - "type": "image/png" |
43 | | - }, |
44 | | - { |
45 | | - "src": "icons/icon-152x152.png", |
46 | | - "sizes": "152x152", |
47 | | - "type": "image/png" |
48 | | - }, |
49 | | - { |
50 | | - "src": "icons/icon-192x192.png", |
51 | | - "sizes": "192x192", |
52 | | - "type": "image/png" |
53 | | - }, |
54 | | - { |
55 | | - "src": "icons/icon-256x256.png", |
56 | | - "sizes": "256x256", |
57 | | - "type": "image/png" |
58 | | - }, |
59 | | - { |
60 | | - "src": "icons/icon-384x384.png", |
61 | | - "sizes": "384x384", |
62 | | - "type": "image/png" |
63 | | - }, |
64 | | - { |
65 | | - "src": "icons/icon-512x512.png", |
66 | | - "sizes": "512x512", |
67 | | - "type": "image/png" |
68 | | - } |
69 | | - ], |
| 20 | + { |
| 21 | + src: "icons/icon-48x48.png", |
| 22 | + sizes: "48x48", |
| 23 | + type: "image/png", |
| 24 | + }, |
| 25 | + { |
| 26 | + src: "icons/icon-72x72.png", |
| 27 | + sizes: "72x72", |
| 28 | + type: "image/png", |
| 29 | + }, |
| 30 | + { |
| 31 | + src: "icons/icon-96x96.png", |
| 32 | + sizes: "96x96", |
| 33 | + type: "image/png", |
| 34 | + }, |
| 35 | + { |
| 36 | + src: "icons/icon-128x128.png", |
| 37 | + sizes: "128x128", |
| 38 | + type: "image/png", |
| 39 | + }, |
| 40 | + { |
| 41 | + src: "icons/icon-144x144.png", |
| 42 | + sizes: "144x144", |
| 43 | + type: "image/png", |
| 44 | + }, |
| 45 | + { |
| 46 | + src: "icons/icon-152x152.png", |
| 47 | + sizes: "152x152", |
| 48 | + type: "image/png", |
| 49 | + }, |
| 50 | + { |
| 51 | + src: "icons/icon-192x192.png", |
| 52 | + sizes: "192x192", |
| 53 | + type: "image/png", |
| 54 | + }, |
| 55 | + { |
| 56 | + src: "icons/icon-256x256.png", |
| 57 | + sizes: "256x256", |
| 58 | + type: "image/png", |
| 59 | + }, |
| 60 | + { |
| 61 | + src: "icons/icon-384x384.png", |
| 62 | + sizes: "384x384", |
| 63 | + type: "image/png", |
| 64 | + }, |
| 65 | + { |
| 66 | + src: "icons/icon-512x512.png", |
| 67 | + sizes: "512x512", |
| 68 | + type: "image/png", |
| 69 | + }, |
| 70 | + ], |
70 | 71 | }, |
71 | 72 | }), |
72 | 73 | ], |
| 74 | + define: { |
| 75 | + __APP_VERSION__: JSON.stringify(pkg.version), |
| 76 | + }, |
73 | 77 | }); |
0 commit comments