๐Ÿ“ฆ GJSBRT / playmix

๐Ÿ“„ vite.config.js ยท 62 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';

export default defineConfig({
    build: {
        sourcemap: true,
    },
    plugins: [
        laravel({
            input: 'resources/js/app.tsx',
            refresh: true,
        }),
        react(),
        VitePWA({
            workbox: {
                globPatterns: ['**/*.{js,css,html,ico,png,svg}']
            },
            additionalManifestEntries: [
                { url: '/favicon.ico', revision: `${Date.now()}` }
            ],
            outDir: 'public',
            registerType: 'autoUpdate',
            injectManifest: {
                enableWorkboxModulesLogs: true,
            },
			devOptions: {
				enabled: true
			},
            scope: '/',
            manifest: {
                id: '/',
                scope: '/',
                start_url: '/',
                orientation: 'portrait',
                name: 'Playmix',
                short_name: 'Playmix',
                description: 'Play interactive games together.',
                theme_color: '#3880ff',
                background: {
                    service_worker: "sw.js"
                },
                icons: [
                    {
                        "src": "/qr-hunt-logo-192.png",
                        "sizes": "192x192",
                        "type": "image/png",
                        "purpose": "maskable any"
                    },
                    {
                        "src": "/qr-hunt-logo-512.png",
                        "sizes": "512x512",
                        "type": "image/png",
                        "purpose": "maskable any"
                    }
                ]
            }
        })
    ],
});